Compare commits

...
114 Commits
Author SHA1 Message Date
Nassim Jahnke 65afe42d2c 4.3.0 Release 2022-06-05 11:32:43 +02:00
Nassim Jahnke 9da206e280 Add sanity check in 1.13->1.12 enchantment handler
Closes #2908
2022-06-03 18:19:54 +02:00
Nassim Jahnke c2ae3df1db Fix 1.13->1.12 item cooldown
Fixes #450
2022-05-29 15:51:02 +02:00
Nassim Jahnke dc9fe10779 Fix join game reading 2022-05-23 19:32:54 +02:00
Nassim Jahnke 08a583526e 1.19-pre2 2022-05-23 18:17:17 +02:00
Nassim Jahnke 125fa885f6 Dont clear dimension storage on server switch 2022-05-21 10:57:39 +02:00
Nassim Jahnke 4a1eefcf87 1.19-pre1 2022-05-18 21:08:05 +02:00
Nassim Jahnke 68c0a0b333 Handle argument types, update Via usage 2022-05-14 12:32:10 +02:00
Nassim Jahnke fdc73126f7 Timestamp is millis now, fix dimension storage 2022-05-13 10:11:26 +02:00
Nassim Jahnke 1e0c0ebb2d 22w19a (almost, also more dread) 2022-05-12 23:56:24 +02:00
Nassim Jahnke 5bffa2c51c Fix clientbound chat message reading 2022-05-08 12:05:46 +02:00
Nassim Jahnke 34fa4f85db More or less handle new chat type formats 2022-05-05 11:24:19 +02:00
Nassim Jahnke ef0e412d36 22w18a
I hate codecs
2022-05-04 23:18:50 +02:00
Nassim Jahnke 7df02934f3 22w17a (and even more dread) 2022-04-27 22:38:41 +02:00
Nassim Jahnke d64b259b77 Remove painting variant tags 2022-04-20 21:41:38 +02:00
Nassim Jahnke 8850d5c8ff 22w16b (probably, also ignoring a possible race condition) 2022-04-20 21:00:45 +02:00
Nassim Jahnke 15c7106430 22w15a 2022-04-13 18:48:53 +02:00
Nassim Jahnke 56dfc985d2 Add item mappings, rename carpets tag for older versions 2022-04-06 22:53:45 +02:00
Nassim Jahnke dfa778942c 22w14a 2022-04-06 20:37:16 +02:00
Nassim Jahnke bd71833f18 22w13a 2022-03-31 19:00:43 +02:00
Nassim Jahnke c6f25bf33f Merge remote-tracking branch 'origin/master' into dev 2022-03-30 11:08:33 +02:00
Nassim Jahnke fc22d7e6c8 Don't warn for non-horse armor on horses
Closes #448
2022-03-30 11:07:38 +02:00
Nassim Jahnke 22f604cd7e Fix parrot imitate warden key 2022-03-30 11:06:25 +02:00
Nassim Jahnke a85b9e8100 Remove full frog metadata, add translation mappings 2022-03-24 20:10:19 +01:00
Nassim Jahnke 8d380f4278 22w12a 2022-03-24 19:31:11 +01:00
Nassim Jahnke 1486d58813 Comment out entity effect transformer 2022-03-21 10:42:37 +01:00
Nassim Jahnke 9d3de047a0 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	build.gradle.kts
2022-03-18 12:21:34 +01:00
Nassim Jahnke c75e5bd6a7 4.2.1 Release 2022-03-18 12:07:11 +01:00
Quantum64 30a3a4fb89 Prevent 1.16 -> 1.17 cursor desync with dragging (mostly fixes #389) (#445) 2022-03-18 11:01:46 +01:00
Lucas 9fe9cd3a8a Map smoke directions from 1.13.1 to 1.13 (#413) 2022-03-18 10:52:37 +01:00
Nassim Jahnke 12926980e2 Also remove block entities above 255 in chunk data for 1.17->1.16 2022-03-18 10:32:34 +01:00
Nassim Jahnke 31787b5e5b Fix Velocity/Sponge config location 2022-03-18 10:30:55 +01:00
Nassim Jahnke d56921b611 Actually everything from 22w11a 2022-03-16 23:06:58 +01:00
Nassim Jahnke 15a5e6f710 22w11a 2022-03-16 22:52:19 +01:00
Nassim Jahnke 422f2b699b 1.19 Experimental Snapshot 1 2022-03-16 19:08:08 +01:00
Nassim Jahnke eda8abf55c Handle new biomes for <1.16 clients
Fixes #422
2022-03-13 11:29:34 +01:00
Nassim Jahnke 2b955894d3 Update gradle wrapper to 7.4.1 2022-03-09 18:50:30 +01:00
Nassim Jahnke 539c4e696a Fix long scoreboard objective names for <1.18 clients 2022-03-06 15:41:51 +01:00
Nassim Jahnke aa35ace816 Don't send block entities < 0 for 1.16- players
Fixes ViaVersion/ViaVersion#2833
2022-03-01 10:21:22 +01:00
Nassim Jahnke 8ea7686b2c Bump version to 4.2.1-SNAPSHOT 2022-03-01 10:19:31 +01:00
Nassim Jahnke 7dbd620886 4.2.0 Release 2022-02-24 09:44:23 +01:00
Nassim Jahnke 6a1b0e044a 1.18.2-pre3 2022-02-23 18:13:48 +01:00
Nassim Jahnke afe3584b70 1.18.2 pre1 2022-02-18 18:33:34 +01:00
Nassim Jahnke d8096e7f2e Wither skeletons don't need visible names 2022-02-16 19:15:08 +01:00
Nassim Jahnke 121c735073 Fix registry on respawn 2022-02-09 19:58:04 +01:00
Nassim Jahnke 52698423d0 22w06a 2022-02-09 18:57:28 +01:00
Nassim Jahnke bbff706890 Merge branch 'master' into dev 2022-01-26 09:57:29 +01:00
Nassim Jahnke 2a079be7c2 Make custom world height warning actual warning
Closes ViaVersion/ViaVersion#2805
2022-01-23 17:04:30 +01:00
Nassim Jahnke a8e767250a Fix 1.17->1.16 heightmap conversion
Fixes ViaVersion/ViaVersion#2801
2022-01-22 11:52:09 +01:00
creeper123123321 5593dfb8e5 Fix 1.14->1.13 difficulty (#427) 2022-01-20 12:34:10 +01:00
Nassim Jahnke afd072c313 Mmm 2022-01-19 18:14:21 +01:00
Nassim Jahnke d26cac9622 22w03a 2022-01-19 18:13:33 +01:00
Nassim Jahnke 2c341ab7ad Update copyright 2022-01-09 22:40:10 +01:00
Nassim Jahnke 54eaccca0d Update Sponge module to API v8 2022-01-09 18:58:44 +01:00
Nassim Jahnke 0d5661f8a6 Remove bad 1.13->1.12 sound warning, update shadow
Fixes #424
2022-01-03 18:38:01 +01:00
Nassim Jahnke 7a19cb8d04 Update shadow and Gradle wrapper 2021-12-23 11:41:57 +01:00
FrostBird347 9fddf7b176 Update mapping-1.16.2to1.17.json (#417) 2021-12-05 09:40:42 +01:00
Lucas f687dff702 Add missing block entity NBT on 1.18 (#414) 2021-12-04 16:36:46 +01:00
Nassim Jahnke 249280312e Fix advancement translatables
Closes #415
2021-12-04 16:33:30 +01:00
Nassim Jahnke a200975cda Bump version to 4.1.2-SNAPSHOT 2021-12-04 16:21:06 +01:00
Nassim Jahnke 0163bc8c24 4.1.1 Release 2021-12-03 13:36:40 +01:00
Nassim Jahnke a5a789c440 Fix handling of untracked entities
Some simple meta handlers do not go through entity rewriters, suddenly having to deal with invalid metadata because of plugins' bad concurrency handling
Closes #412
2021-12-03 11:00:52 +01:00
Nassim Jahnke 87aed8f3f2 Fix NPE
Fixes ViaVersion/ViaVersion#2751
2021-12-03 08:59:28 +01:00
Nassim Jahnke cadab9e6bb Throw error on unhandled 1.14->1.13 metadata 2021-12-02 12:43:42 +01:00
Nassim Jahnke 13b5545999 Fix vibration and transition particle meta 2021-12-02 11:11:34 +01:00
Nassim Jahnke f4a6c20695 Update Gradle wrapper to 7.3.1 2021-12-02 11:02:55 +01:00
Nassim Jahnke ff583e40fb Fix 1.18 mountain biomes in biome registry 2021-12-01 17:04:05 +01:00
Nassim Jahnke c8b0ca48de Bump version to 4.1.1-SNAPSHOT 2021-12-01 17:03:41 +01:00
Nassim Jahnke 8d35d16575 4.1.0 Release 2021-11-29 21:01:23 +01:00
Nassim Jahnke e70f595f76 Handle translatable changes 2021-11-19 22:09:36 +01:00
Nassim Jahnke 888441b81d Set mappings default values to -1 2021-11-17 19:52:31 +01:00
Nassim Jahnke 71f4012537 Update leftover Via usage 2021-11-17 11:18:46 +01:00
Nassim Jahnke ce6ca4dc0f 1.18-pre2 2021-11-16 19:40:17 +01:00
Nassim Jahnke becba6498e Make mapped entity names configurable 2021-11-13 11:06:59 +01:00
Nassim Jahnke 95bc340b06 Fix play record, remove unused 1.18 code 2021-11-12 13:18:02 +01:00
Nassim Jahnke 1ab93c4021 Update Gradle wrapper to 7.3 2021-11-10 17:47:36 +01:00
Nassim Jahnke b36052465f Fix 1.18 spawner entity/block entity update 2021-11-10 17:34:04 +01:00
Nassim Jahnke 5695726d9a Use new metatypes classes 2021-11-10 17:18:55 +01:00
Nassim Jahnke 025a892daf 21w44a 2021-11-03 19:17:46 +01:00
Nassim Jahnke 74aa5f4598 Merge remote-tracking branch 'origin/master' into dev 2021-10-26 11:09:59 +02:00
Nassim Jahnke db345577a2 Fix 1.13.1->1.13 inventory title regression
Fixes #375
2021-10-26 11:09:42 +02:00
Nassim Jahnke 80f41c8c24 Merge remote-tracking branch 'origin/master' into dev 2021-10-24 16:44:35 +02:00
Nassim Jahnke 169650f17c Remove unnecessary type reading 2021-10-24 16:44:22 +02:00
Nassim Jahnke 4361ebe636 Use correct meta type 2021-10-21 09:12:51 +02:00
Nassim Jahnke 9d52fd6212 21w42a 2021-10-20 19:02:20 +02:00
Nassim Jahnke abb2abe5c9 Update biome palette reading 2021-10-13 21:15:59 +02:00
Nassim Jahnke e9d1d257ea Merge remote-tracking branch 'origin/master' into dev 2021-10-11 21:05:31 +02:00
Nassim Jahnke a721eb4d03 Update shadow 2021-10-11 21:05:21 +02:00
Nassim Jahnke fe644127c1 Merge remote-tracking branch 'origin/master' into dev 2021-10-11 11:06:27 +02:00
Nassim Jahnke 71cc1ca4b5 Ignore invalid enchantment tags
Fixes ViaVersion/ViaVersion#2693
2021-10-11 11:05:50 +02:00
Nassim Jahnke 5df0dacf92 21w40a 2021-10-07 16:56:22 +02:00
Nassim Jahnke 448f452965 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	gradle/libs.versions.toml
2021-10-07 15:33:06 +02:00
Nassim Jahnke 3d6c31c479 Update FU load factor usage 2021-10-07 12:37:07 +02:00
Nassim Jahnke 067c93a63a Cancel null block entity nbt updates 2021-09-25 10:11:43 +02:00
Nassim Jahnke 04a970ef08 21w38a 2021-09-24 14:39:19 +02:00
Nassim Jahnke 3d32cb3adf Map new sounds (to nothing) 2021-09-17 09:41:14 +02:00
Nassim Jahnke 1ef1a861ca Fix block entity ids 2021-09-16 18:31:03 +02:00
Nassim JahnkeandGerrygames deb11bf1a9 21w37a works™️
Co-authored-by: Gerrygames <gecam59@gmail.com>
2021-09-16 18:19:23 +02:00
Nassim Jahnke 87ad6bd2b1 More work on 21w37a 2021-09-16 17:05:19 +02:00
Nassim Jahnke 3054b758df 21w37a (probably) 2021-09-16 14:57:52 +02:00
Nassim Jahnke 5777f4a117 Start working on 1.18 2021-09-14 18:16:12 +02:00
Nassim Jahnke 9615a5aba2 Add todo, map world name in 1.17 packets 2021-09-14 17:37:05 +02:00
Nassim Jahnke 8fff947863 Map powder snow bucket to snow block
Fixes #397
2021-09-07 11:25:04 +02:00
kennytv 68f77cc809 Update Gradle to 7.2 2021-08-17 13:39:55 +02:00
kennytv 4f801b4228 Fix 1.16->1.15 wolf anger
Fixes #392
2021-08-14 10:51:49 +02:00
kennytv 54dc05046f Fix entity id int type 2021-08-11 15:08:01 +02:00
kennytv e05c585b37 Fix 1.14 position tracking of client
Fixes #391
2021-08-11 08:55:42 +02:00
kennytv a03a3a2a8d Fix NPE in 1.16 TranslatableRewriter
Closes ViaVersion/ViaVersion#2655
2021-08-09 09:08:15 +02:00
kennytv e251565837 Don't ignore gitignores 2021-08-09 09:03:54 +02:00
kennytv 455bb546f0 Add option to replace ping packets by using container acks
Closes ViaVersion/ViaVersion#2624
2021-07-17 11:13:01 +02:00
kennytv fa707e5391 Ignore untracked entity meta 2021-07-11 17:35:17 +02:00
kennytv 6f2961a00b Lowercase gang 2021-07-07 20:42:50 +02:00
KennyTV 43ebe3c3e3 Fix 1.17->1.16 and 1.16.2->1.16.1 meta types 2021-07-07 10:15:32 +02:00
KennyTV f8d10be031 Bump version to 4.0.2-SNAPSHOT 2021-07-07 10:08:35 +02:00
194 changed files with 4680 additions and 817 deletions

No files matched your search

+2 -6
View File
@@ -18,6 +18,8 @@ hs_err_pid*
# Ignore IDEA directory
.idea/*
!.idea/copyright/*
!.idea/scopes/*
# Include the project's dictionary
!.idea/dictionaries/
@@ -105,9 +107,3 @@ nbdist/
nbactions.xml
nb-configuration.xml
.nb-gradle/
### Git ###
# Don't exclude the .gitignore itself
!.gitignore
+10
View File
@@ -0,0 +1,10 @@
<component name="CopyrightManager">
<settings>
<module2copyright>
<element module="ViaBackwards" copyright="viabackwards-gpl" />
</module2copyright>
<LanguageOptions name="__TEMPLATE__">
<option name="addBlankAfter" value="false" />
</LanguageOptions>
</settings>
</component>
+6
View File
@@ -0,0 +1,6 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards&#10;Copyright (C) 2016-2022 ViaVersion and contributors&#10;&#10;This program is free software: you can redistribute it and/or modify&#10;it under the terms of the GNU General Public License as published by&#10;the Free Software Foundation, either version 3 of the License, or&#10;(at your option) any later version.&#10;&#10;This program is distributed in the hope that it will be useful,&#10;but WITHOUT ANY WARRANTY; without even the implied warranty of&#10;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10;GNU General Public License for more details.&#10;&#10;You should have received a copy of the GNU General Public License&#10;along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;." />
<option name="myName" value="viabackwards-gpl" />
</copyright>
</component>
+3
View File
@@ -0,0 +1,3 @@
<component name="DependencyValidationManager">
<scope name="ViaBackwards" pattern="com.viaversion.viabackwards..*" />
</component>
+1 -1
View File
@@ -11,7 +11,7 @@ Supported Versions
**Green** = ViaVersion\
**Purple** = ViaBackwards addition
![supported_versions](https://i.imgur.com/MGmk8Yp.png)
![supported_versions](https://i.imgur.com/O2KAFFL.png)
Releases / Dev Builds
-
+1 -1
View File
@@ -8,5 +8,5 @@ repositories {
dependencies {
// version must be manually kept in sync with the one in root project settings.gradle.kts
implementation("gradle.plugin.com.github.jengelman.gradle.plugins", "shadow", "7.0.0")
implementation("gradle.plugin.com.github.johnrengelman", "shadow", "7.1.2")
}
@@ -6,7 +6,7 @@ plugins {
tasks {
// Variable replacements
processResources {
filesMatching(listOf("plugin.yml", "mcmod.info", "fabric.mod.json", "bungee.yml")) {
filesMatching(listOf("plugin.yml", "META-INF/sponge_plugins.json", "fabric.mod.json", "bungee.yml")) {
expand("version" to project.version, "description" to project.description, "url" to "https://github.com/ViaVersion/ViaBackwards")
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ plugins {
allprojects {
group = "com.viaversion"
version = "4.0.1"
version = "4.3.0"
description = "Allow older clients to join newer server versions."
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -4,7 +4,7 @@ description: Allow older Minecraft versions to connect to a newer server version
main: com.viaversion.viabackwards.BukkitPlugin
api-version: 1.13
authors: [Matsv, KennyTV, Gerrygames, creeper123123321, ForceUpdate1]
authors: [Matsv, kennytv, Gerrygames, creeper123123321, ForceUpdate1]
website: ${url}
depend: [ViaVersion]
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -1,5 +1,5 @@
name: ViaBackwards
main: com.viaversion.viabackwards.BungeePlugin
author: "Matsv, KennyTV, Gerrygames, creeper123123321, ForceUpdate1"
author: "Matsv, kennytv, Gerrygames, creeper123123321, ForceUpdate1"
version: ${version}
depends: [ViaVersion]
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,10 +18,12 @@
package com.viaversion.viabackwards;
import com.viaversion.viaversion.util.Config;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.io.File;
import java.net.URL;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -31,6 +33,9 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
private boolean addTeamColorToPrefix;
private boolean fix1_13FacePlayer;
private boolean alwaysShowOriginalMobName;
private boolean fix1_13FormattedInventoryTitles;
private boolean handlePingsAsInvAcknowledgements;
private Map<String, String> chatTypeFormats;
public ViaBackwardsConfig(File configFile) {
super(configFile);
@@ -46,7 +51,10 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
addCustomEnchantsToLore = getBoolean("add-custom-enchants-into-lore", true);
addTeamColorToPrefix = getBoolean("add-teamcolor-to-prefix", true);
fix1_13FacePlayer = getBoolean("fix-1_13-face-player", false);
fix1_13FormattedInventoryTitles = getBoolean("fix-formatted-inventory-titles", true);
alwaysShowOriginalMobName = getBoolean("always-show-original-mob-name", true);
handlePingsAsInvAcknowledgements = getBoolean("handle-pings-as-inv-acknowledgements", false);
chatTypeFormats = get("chat-types", Map.class, new HashMap<String, String>());
}
@Override
@@ -64,11 +72,26 @@ public class ViaBackwardsConfig extends Config implements com.viaversion.viaback
return fix1_13FacePlayer;
}
@Override
public boolean fix1_13FormattedInventoryTitle() {
return fix1_13FormattedInventoryTitles;
}
@Override
public boolean alwaysShowOriginalMobName() {
return alwaysShowOriginalMobName;
}
@Override
public boolean handlePingsAsInvAcknowledgements() {
return handlePingsAsInvAcknowledgements || Boolean.getBoolean("com.viaversion.handlePingsAsInvAcknowledgements");
}
@Override
public @Nullable String chatTypeFormat(final String translationKey) {
return chatTypeFormats.get(translationKey);
}
@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viabackwards/config.yml");
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,6 +17,8 @@
*/
package com.viaversion.viabackwards.api;
import org.checkerframework.checker.nullness.qual.Nullable;
public interface ViaBackwardsConfig {
/**
@@ -40,10 +42,16 @@ public interface ViaBackwardsConfig {
*/
boolean isFix1_13FacePlayer();
boolean fix1_13FormattedInventoryTitle();
/**
* Always shows the original mob's name instead of only when hovering over them with the cursor.
*
* @return true if enabled
*/
boolean alwaysShowOriginalMobName();
boolean handlePingsAsInvAcknowledgements();
@Nullable String chatTypeFormat(String translationKey);
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -43,7 +43,10 @@ import com.viaversion.viabackwards.protocol.protocol1_16_2to1_16_3.Protocol1_16_
import com.viaversion.viabackwards.protocol.protocol1_16_3to1_16_4.Protocol1_16_3To1_16_4;
import com.viaversion.viabackwards.protocol.protocol1_16_4to1_17.Protocol1_16_4To1_17;
import com.viaversion.viabackwards.protocol.protocol1_16to1_16_1.Protocol1_16To1_16_1;
import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.Protocol1_17_1To1_18;
import com.viaversion.viabackwards.protocol.protocol1_17to1_17_1.Protocol1_17To1_17_1;
import com.viaversion.viabackwards.protocol.protocol1_18_2to1_19.Protocol1_18_2To1_19;
import com.viaversion.viabackwards.protocol.protocol1_18to1_18_2.Protocol1_18To1_18_2;
import com.viaversion.viabackwards.protocol.protocol1_9_4to1_10.Protocol1_9_4To1_10;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.ProtocolManager;
@@ -55,7 +58,7 @@ import java.util.logging.Logger;
public interface ViaBackwardsPlatform {
String MINIMUM_VV_VERSION = "4.0.1";
String MINIMUM_VV_VERSION = "4.3.0";
String IMPL_VERSION = "$IMPL_VERSION";
/**
@@ -106,6 +109,11 @@ public interface ViaBackwardsPlatform {
protocolManager.registerProtocol(new Protocol1_16_4To1_17(), ProtocolVersion.v1_16_4, ProtocolVersion.v1_17);
protocolManager.registerProtocol(new Protocol1_17To1_17_1(), ProtocolVersion.v1_17, ProtocolVersion.v1_17_1);
protocolManager.registerProtocol(new Protocol1_17_1To1_18(), ProtocolVersion.v1_17_1, ProtocolVersion.v1_18);
protocolManager.registerProtocol(new Protocol1_18To1_18_2(), ProtocolVersion.v1_18, ProtocolVersion.v1_18_2);
protocolManager.registerProtocol(new Protocol1_18_2To1_19(), ProtocolVersion.v1_18_2, ProtocolVersion.v1_19);
}
/**
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -36,6 +36,7 @@ public class BackwardsMappings extends MappingDataBase {
private final Class<? extends Protocol> vvProtocolClass;
private Int2ObjectMap<MappedItem> backwardsItemMappings;
private Map<String, String> backwardsSoundMappings;
private Map<String, String> entityNames;
public BackwardsMappings(String oldVersion, String newVersion, @Nullable Class<? extends Protocol> vvProtocolClass) {
this(oldVersion, newVersion, vvProtocolClass, false);
@@ -60,7 +61,12 @@ public class BackwardsMappings extends MappingDataBase {
JsonObject diffSounds = diffMappings.getAsJsonObject("sounds");
if (diffSounds != null) {
backwardsSoundMappings = VBMappingDataLoader.objectToMap(diffSounds);
backwardsSoundMappings = VBMappingDataLoader.objectToNamespacedMap(diffSounds);
}
JsonObject diffEntityNames = diffMappings.getAsJsonObject("entitynames");
if (diffEntityNames != null) {
entityNames = VBMappingDataLoader.objectToMap(diffEntityNames);
}
}
@@ -77,7 +83,8 @@ public class BackwardsMappings extends MappingDataBase {
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
return new VBMappings(oldMappings.getAsJsonArray(key), newMappings.getAsJsonArray(key), diff, shouldWarnOnMissing(key));
return VBMappings.vbBuilder().unmapped(oldMappings.getAsJsonArray(key)).mapped(newMappings.getAsJsonArray(key))
.diffMappings(diff).warnOnMissing(shouldWarnOnMissing(key)).build();
}
@Override
@@ -85,7 +92,8 @@ public class BackwardsMappings extends MappingDataBase {
if (!oldMappings.has(key) || !newMappings.has(key)) return null;
JsonObject diff = diffMappings != null ? diffMappings.getAsJsonObject(key) : null;
return new VBMappings(oldMappings.getAsJsonObject(key), newMappings.getAsJsonObject(key), diff, shouldWarnOnMissing(key));
return VBMappings.vbBuilder().unmapped(oldMappings.getAsJsonObject(key)).mapped(newMappings.getAsJsonObject(key))
.diffMappings(diff).warnOnMissing(shouldWarnOnMissing(key)).build();
}
@Override
@@ -100,7 +108,7 @@ public class BackwardsMappings extends MappingDataBase {
}
protected boolean shouldWarnOnMissing(String key) {
return !key.equals("blocks") && !key.equals("statistics");
return !key.equals("blocks") && !key.equals("statistics") && !key.equals("entities");
}
@Override
@@ -134,7 +142,7 @@ public class BackwardsMappings extends MappingDataBase {
}
public @Nullable String getMappedNamedSound(String id) {
if (backwardsItemMappings == null) {
if (backwardsSoundMappings == null) {
return null;
}
@@ -145,6 +153,15 @@ public class BackwardsMappings extends MappingDataBase {
return backwardsSoundMappings.get(id);
}
public @Nullable String mappedEntityName(String entityName) {
if (entityNames == null) {
ViaBackwards.getPlatform().getLogger().severe("No entity mappings found when requesting them for " + entityName);
new Exception().printStackTrace();
return null;
}
return entityNames.get(entityName);
}
public @Nullable Int2ObjectMap<MappedItem> getBackwardsItemMappings() {
return backwardsItemMappings;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -38,7 +38,7 @@ import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
public class VBMappingDataLoader {
public final class VBMappingDataLoader {
public static JsonObject loadFromDataDir(String name) {
File file = new File(ViaBackwards.getPlatform().getDataFolder(), name);
@@ -68,12 +68,8 @@ public class VBMappingDataLoader {
}
}
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, JsonObject diffIdentifiers) {
mapIdentifiers(output, oldIdentifiers, newIdentifiers, diffIdentifiers, true);
}
public static void mapIdentifiers(int[] output, JsonObject oldIdentifiers, JsonObject newIdentifiers, JsonObject diffIdentifiers, boolean warnOnMissing) {
Object2IntMap newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(newIdentifiers);
for (Map.Entry<String, JsonElement> entry : oldIdentifiers.entrySet()) {
String key = entry.getValue().getAsString();
int mappedId = newIdentifierMap.getInt(key);
@@ -113,8 +109,8 @@ public class VBMappingDataLoader {
}
}
public static Map<String, String> objectToMap(JsonObject object) {
Map<String, String> mappings = new HashMap<>();
public static Map<String, String> objectToNamespacedMap(JsonObject object) {
Map<String, String> mappings = new HashMap<>(object.size());
for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
String key = entry.getKey();
if (key.indexOf(':') == -1) {
@@ -129,12 +125,16 @@ public class VBMappingDataLoader {
return mappings;
}
public static Int2ObjectMap<MappedItem> loadItemMappings(JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping) {
return loadItemMappings(oldMapping, newMapping, diffMapping, false);
public static Map<String, String> objectToMap(JsonObject object) {
Map<String, String> mappings = new HashMap<>(object.size());
for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
mappings.put(entry.getKey(), entry.getValue().getAsString());
}
return mappings;
}
public static Int2ObjectMap<MappedItem> loadItemMappings(JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping, boolean warnOnMissing) {
Int2ObjectMap<MappedItem> itemMapping = new Int2ObjectOpenHashMap<>(diffMapping.size(), 1F);
Int2ObjectMap<MappedItem> itemMapping = new Int2ObjectOpenHashMap<>(diffMapping.size(), 0.99F);
Object2IntMap<String> newIdenfierMap = MappingDataLoader.indexedObjectToMap(newMapping);
Object2IntMap<String> oldIdenfierMap = MappingDataLoader.indexedObjectToMap(oldMapping);
for (Map.Entry<String, JsonElement> entry : diffMapping.entrySet()) {
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,33 +18,47 @@
package com.viaversion.viabackwards.api.data;
import com.viaversion.viaversion.api.data.IntArrayMappings;
import com.viaversion.viaversion.libs.gson.JsonArray;
import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.data.Mappings;
import java.util.Arrays;
public class VBMappings extends IntArrayMappings {
public final class VBMappings extends IntArrayMappings {
public VBMappings(int size, JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping, boolean warnOnMissing) {
super(create(size, oldMapping, newMapping, diffMapping, warnOnMissing));
private VBMappings(final int[] oldToNew, final int mappedIds) {
super(oldToNew, mappedIds);
}
public VBMappings(JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping, boolean warnOnMissing) {
super(create(oldMapping.entrySet().size(), oldMapping, newMapping, diffMapping, warnOnMissing));
public static Mappings.Builder<VBMappings> vbBuilder() {
return new Builder(VBMappings::new);
}
public VBMappings(JsonObject oldMapping, JsonObject newMapping, boolean warnOnMissing) {
this(oldMapping, newMapping, null, warnOnMissing);
}
public static final class Builder extends Mappings.Builder<VBMappings> {
public VBMappings(JsonArray oldMapping, JsonArray newMapping, JsonObject diffMapping, boolean warnOnMissing) {
super(oldMapping.size(), oldMapping, newMapping, diffMapping, warnOnMissing);
}
private Builder(final MappingsSupplier<VBMappings> supplier) {
super(supplier);
}
private static int[] create(int size, JsonObject oldMapping, JsonObject newMapping, JsonObject diffMapping, boolean warnOnMissing) {
int[] oldToNew = new int[size];
Arrays.fill(oldToNew, -1);
VBMappingDataLoader.mapIdentifiers(oldToNew, oldMapping, newMapping, diffMapping, warnOnMissing);
return oldToNew;
@Override
public VBMappings build() {
final int size = this.size != -1 ? this.size : size(unmapped);
final int mappedSize = this.mappedSize != -1 ? this.mappedSize : size(mapped);
final int[] mappings = new int[size];
Arrays.fill(mappings, -1);
// Do conversion if one is an array and the other an object, otherwise directly map
if (unmapped.isJsonArray()) {
if (mapped.isJsonObject()) {
VBMappingDataLoader.mapIdentifiers(mappings, toJsonObject(unmapped.getAsJsonArray()), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
} else {
// Use the normal loader
MappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonArray(), mapped.getAsJsonArray(), diffMappings, warnOnMissing);
}
} else if (mapped.isJsonArray()) {
VBMappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), toJsonObject(mapped.getAsJsonArray()), diffMappings, warnOnMissing);
} else {
VBMappingDataLoader.mapIdentifiers(mappings, unmapped.getAsJsonObject(), mapped.getAsJsonObject(), diffMappings, warnOnMissing);
}
return supplier.supply(mappings, mappedSize);
}
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,27 +18,40 @@
package com.viaversion.viabackwards.api.entities.storage;
import com.viaversion.viabackwards.ViaBackwards;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.ChatRewriter;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Locale;
public class EntityData {
private final BackwardsProtocol<?, ?, ?, ?> protocol;
private final int id;
private final int replacementId;
private Object mobName;
private final String key;
private NameVisibility nameVisibility = NameVisibility.NONE;
private MetaCreator defaultMeta;
public EntityData(int id, int replacementId) {
this.id = id;
this.replacementId = replacementId;
public EntityData(BackwardsProtocol<?, ?, ?, ?> protocol, EntityType type, int replacementId) {
this(protocol, type.name(), type.getId(), replacementId);
}
public EntityData jsonName(String name) {
this.mobName = ChatRewriter.legacyTextToJson(name);
public EntityData(BackwardsProtocol<?, ?, ?, ?> protocol, String key, int id, int replacementId) {
this.protocol = protocol;
this.id = id;
this.replacementId = replacementId;
this.key = key.toLowerCase(Locale.ROOT);
}
public EntityData jsonName() {
this.nameVisibility = NameVisibility.JSON;
return this;
}
public EntityData mobName(String name) {
this.mobName = name;
public EntityData plainName() {
this.nameVisibility = NameVisibility.PLAIN;
return this;
}
@@ -59,7 +72,16 @@ public class EntityData {
* @return custom mobname, can be either a String or a JsonElement
*/
public @Nullable Object mobName() {
return mobName;
if (nameVisibility == NameVisibility.NONE) {
return null;
}
String name = protocol.getMappingData().mappedEntityName(key);
if (name == null) {
ViaBackwards.getPlatform().getLogger().warning("Entity name for " + key + " not found in protocol " + protocol.getClass().getSimpleName());
name = key;
}
return nameVisibility == NameVisibility.JSON ? ChatRewriter.legacyTextToJson(name) : name;
}
public int replacementId() {
@@ -82,7 +104,7 @@ public class EntityData {
public String toString() {
return "EntityData{" +
"id=" + id +
", mobName='" + mobName + '\'' +
", mobName='" + key + '\'' +
", replacementId=" + replacementId +
", defaultMeta=" + defaultMeta +
'}';
@@ -93,4 +115,10 @@ public class EntityData {
void createMeta(WrappedMetadata storage);
}
private enum NameVisibility {
PLAIN,
JSON,
NONE
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,19 +17,19 @@
*/
package com.viaversion.viabackwards.api.entities.storage;
import com.viaversion.viabackwards.api.BackwardsProtocol;
public class EntityObjectData extends EntityData {
private final boolean isObject;
private final int objectData;
public EntityObjectData(int id, boolean isObject, int replacementId, int objectData) {
super(id, replacementId);
this.isObject = isObject;
public EntityObjectData(BackwardsProtocol<?, ?, ?, ?> protocol, String key, int id, int replacementId, int objectData) {
super(protocol, key, id, replacementId);
this.objectData = objectData;
}
@Override
public boolean isObjectType() {
return isObject;
return true;
}
@Override
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -63,14 +63,19 @@ public class EntityPositionHandler {
return;
}
EntityPositionStorage positionStorage = create ? storageSupplier.get() : storedEntity.get(storageClass);
if (positionStorage == null) {
ViaBackwards.getPlatform().getLogger().warning("Stored entity with id " + entityId + " missing " + storageClass.getSimpleName());
return;
EntityPositionStorage positionStorage;
if (create) {
positionStorage = storageSupplier.get();
storedEntity.put(positionStorage);
} else {
positionStorage = storedEntity.get(storageClass);
if (positionStorage == null) {
ViaBackwards.getPlatform().getLogger().warning("Stored entity with id " + entityId + " missing " + storageClass.getSimpleName());
return;
}
}
positionStorage.setCoordinates(x, y, z, relative);
storedEntity.put(positionStorage);
}
public EntityPositionStorage getStorage(UserConnection user, int entityId) {
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -87,10 +87,10 @@ public class EnchantmentRewriter {
Iterator<Tag> iterator = enchantments.iterator();
while (iterator.hasNext()) {
CompoundTag enchantmentEntry = (CompoundTag) iterator.next();
StringTag idTag = enchantmentEntry.get("id");
if (idTag == null) continue;
Tag idTag = enchantmentEntry.get("id");
if (!(idTag instanceof StringTag)) continue;
String enchantmentId = idTag.getValue();
String enchantmentId = ((StringTag) idTag).getValue();
String remappedName = enchantmentMappings.get(enchantmentId);
if (remappedName != null) {
if (!changed) {
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,17 +20,17 @@ package com.viaversion.viabackwards.api.rewriters;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_14;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_14;
public abstract class EntityRewriter<T extends BackwardsProtocol> extends EntityRewriterBase<T> {
protected EntityRewriter(T protocol) {
this(protocol, MetaType1_14.OptChat, MetaType1_14.Boolean);
this(protocol, Types1_14.META_TYPES.optionalComponentType, Types1_14.META_TYPES.booleanType);
}
protected EntityRewriter(T protocol, MetaType displayType, MetaType displayVisibilityType) {
@@ -67,6 +67,17 @@ public abstract class EntityRewriter<T extends BackwardsProtocol> extends Entity
};
}
public PacketHandler getSpawnTrackerWithDataHandler1_19(EntityType fallingBlockType) {
return wrapper -> {
// Check against the UNMAPPED entity type
EntityType entityType = setOldEntityId(wrapper);
if (entityType == fallingBlockType) {
int blockState = wrapper.get(Type.VAR_INT, 2);
wrapper.set(Type.VAR_INT, 2, protocol.getMappingData().getNewBlockStateId(blockState));
}
};
}
public void registerSpawnTracker(ClientboundPacketType packetType) {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
@@ -79,7 +90,13 @@ public abstract class EntityRewriter<T extends BackwardsProtocol> extends Entity
});
}
private EntityType setOldEntityId(PacketWrapper wrapper) throws Exception {
/**
* Sets the mapped entity id and returns the unmapped entity type.
*
* @param wrapper packet wrapper
* @return unmapped (!) entity type
*/
protected EntityType setOldEntityId(PacketWrapper wrapper) throws Exception {
int typeId = wrapper.get(Type.VAR_INT, 1);
EntityType entityType = typeFromId(typeId);
tracker(wrapper.user()).addEntity(wrapper.get(Type.VAR_INT, 0), entityType);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,13 +23,13 @@ import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.api.entities.storage.EntityData;
import com.viaversion.viabackwards.api.entities.storage.WrappedMetadata;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.Int2IntMapMappings;
import com.viaversion.viaversion.api.data.entity.StoredEntityData;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntOpenHashMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
import com.viaversion.viaversion.libs.gson.JsonElement;
@@ -67,7 +67,9 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
super.handleMetadata(entityId, metadataList, connection);
EntityType type = tracker(connection).entityType(entityId);
if (type == null) return;
if (type == null) {
return; // Don't handle untracked entities - basically always the fault of a plugin sending virtual entities through concurrency-unsafe handling
}
EntityData entityData = entityDataForType(type);
@@ -84,11 +86,9 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
}
// Add any other extra meta for mapped entities
if (entityData != null) {
//TODO only do this once for a first meta packet?
if (entityData != null && entityData.hasBaseMeta()) {
entityData.defaultMeta().createMeta(new WrappedMetadata(metadataList));
}
//TODO only do this once for a first meta packet?
if (entityData != null && entityData.hasBaseMeta()) {
entityData.defaultMeta().createMeta(new WrappedMetadata(metadataList));
}
}
@@ -131,7 +131,7 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
// Already rewrite the id here
int mappedReplacementId = newEntityId(mappedType.getId());
EntityData data = new EntityData(type.getId(), mappedReplacementId);
EntityData data = new EntityData(protocol, type, mappedReplacementId);
mapEntityType(type.getId(), mappedReplacementId);
entityDataMappings.put(type.getId(), data);
return data;
@@ -147,13 +147,12 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
@Override
public <E extends Enum<E> & EntityType> void mapTypes(EntityType[] oldTypes, Class<E> newTypeClass) {
if (typeMappings == null) {
typeMappings = new Int2IntOpenHashMap(oldTypes.length, 1F);
typeMappings.defaultReturnValue(-1);
typeMappings = Int2IntMapMappings.of();
}
for (EntityType oldType : oldTypes) {
try {
E newType = Enum.valueOf(newTypeClass, oldType.name());
typeMappings.put(oldType.getId(), newType.getId());
typeMappings.setNewId(oldType.getId(), newType.getId());
} catch (IllegalArgumentException ignored) {
// Don't warn
}
@@ -180,9 +179,9 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
}
// ONLY TRACKS, DOESN'T REWRITE IDS
protected PacketHandler getTrackerHandler(Type intType, int typeIndex) {
protected PacketHandler getTrackerHandler(Type<? extends Number> intType, int typeIndex) {
return wrapper -> {
Number id = (Number) wrapper.get(intType, typeIndex);
Number id = wrapper.get(intType, typeIndex);
tracker(wrapper.user()).addEntity(wrapper.get(Type.VAR_INT, 0), typeFromId(id.intValue()));
};
}
@@ -191,7 +190,7 @@ public abstract class EntityRewriterBase<T extends BackwardsProtocol> extends En
return getTrackerHandler(Type.VAR_INT, 1);
}
protected PacketHandler getTrackerHandler(EntityType entityType, Type intType) {
protected PacketHandler getTrackerHandler(EntityType entityType, Type<? extends Number> intType) {
return wrapper -> tracker(wrapper.user()).addEntity((int) wrapper.get(intType, 0), entityType);
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,10 @@ package com.viaversion.viabackwards.api.rewriters;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.api.data.MappedItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.ByteTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.IntTag;
@@ -30,11 +34,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewriterBase<T> {
private final TranslatableRewriter translatableRewriter;
protected ItemRewriter(T protocol, @Nullable TranslatableRewriter translatableRewriter) {
protected ItemRewriter(T protocol) {
super(protocol, true);
this.translatableRewriter = translatableRewriter;
}
@Override
@@ -42,11 +43,11 @@ public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewr
if (item == null) return null;
CompoundTag display = item.tag() != null ? item.tag().get("display") : null;
if (translatableRewriter != null && display != null) {
if (protocol.getTranslatableRewriter() != null && display != null) {
// Handle name and lore components
StringTag name = display.get("Name");
if (name != null) {
String newValue = translatableRewriter.processText(name.getValue()).toString();
String newValue = protocol.getTranslatableRewriter().processText(name.getValue()).toString();
if (!newValue.equals(name.getValue())) {
saveStringTag(display, name, "Name");
}
@@ -61,7 +62,7 @@ public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewr
if (!(loreEntryTag instanceof StringTag)) continue;
StringTag loreEntry = (StringTag) loreEntryTag;
String newValue = translatableRewriter.processText(loreEntry.getValue()).toString();
String newValue = protocol.getTranslatableRewriter().processText(loreEntry.getValue()).toString();
if (!changed && !newValue.equals(loreEntry.getValue())) {
// Backup original lore before doing any modifications
changed = true;
@@ -111,4 +112,52 @@ public abstract class ItemRewriter<T extends BackwardsProtocol> extends ItemRewr
}
return item;
}
@Override
public void registerAdvancements(ClientboundPacketType packetType, Type<Item> type) {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
wrapper.passthrough(Type.BOOLEAN); // Reset/clear
final int size = wrapper.passthrough(Type.VAR_INT); // Mapping size
for (int i = 0; i < size; i++) {
wrapper.passthrough(Type.STRING); // Identifier
// Parent
if (wrapper.passthrough(Type.BOOLEAN)) {
wrapper.passthrough(Type.STRING);
}
// Display data
if (wrapper.passthrough(Type.BOOLEAN)) {
final JsonElement title = wrapper.passthrough(Type.COMPONENT);
final JsonElement description = wrapper.passthrough(Type.COMPONENT);
final TranslatableRewriter translatableRewriter = protocol.getTranslatableRewriter();
if (translatableRewriter != null) {
translatableRewriter.processText(title);
translatableRewriter.processText(description);
}
handleItemToClient(wrapper.passthrough(type)); // Icon
wrapper.passthrough(Type.VAR_INT); // Frame type
int flags = wrapper.passthrough(Type.INT); // Flags
if ((flags & 1) != 0) {
wrapper.passthrough(Type.STRING); // Background texture
}
wrapper.passthrough(Type.FLOAT); // X
wrapper.passthrough(Type.FLOAT); // Y
}
wrapper.passthrough(Type.STRING_ARRAY); // Criteria
final int arrayLength = wrapper.passthrough(Type.VAR_INT);
for (int array = 0; array < arrayLength; array++) {
wrapper.passthrough(Type.STRING_ARRAY); // String array
}
}
});
}
});
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -52,7 +52,7 @@ public abstract class LegacyEntityRewriter<T extends BackwardsProtocol> extends
}
protected EntityObjectData mapObjectType(ObjectType oldObjectType, ObjectType replacement, int data) {
EntityObjectData entData = new EntityObjectData(oldObjectType.getId(), true, replacement.getId(), data);
EntityObjectData entData = new EntityObjectData(protocol, oldObjectType.getType().name(), oldObjectType.getId(), replacement.getId(), data);
objectTypes.put(oldObjectType, entData);
return entData;
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -123,6 +123,17 @@ public class TranslatableRewriter extends ComponentRewriter {
});
}
public void registerCombatKill(ClientboundPacketType packetType) {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
map(Type.INT);
handler(wrapper -> processText(wrapper.passthrough(Type.COMPONENT)));
}
});
}
@Override
protected void handleTranslate(JsonObject root, String translate) {
String newTranslate = newTranslatables.get(translate);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@ import com.viaversion.viaversion.libs.fastutil.ints.Int2IntOpenHashMap;
public class PotionSplashHandler {
private static final Int2IntMap DATA = new Int2IntOpenHashMap(14, 1F);
private static final Int2IntMap DATA = new Int2IntOpenHashMap(14, 0.99F);
static {
DATA.defaultReturnValue(-1);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -215,10 +215,10 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
// Guardian
mapEntityTypeWithData(Entity1_11Types.EntityType.ELDER_GUARDIAN, Entity1_11Types.EntityType.GUARDIAN);
// Skeletons
mapEntityTypeWithData(Entity1_11Types.EntityType.WITHER_SKELETON, Entity1_11Types.EntityType.SKELETON).mobName("Wither Skeleton").spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.STRAY, Entity1_11Types.EntityType.SKELETON).mobName("Stray").spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(2)));
mapEntityTypeWithData(Entity1_11Types.EntityType.WITHER_SKELETON, Entity1_11Types.EntityType.SKELETON).spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.STRAY, Entity1_11Types.EntityType.SKELETON).plainName().spawnMetadata(storage -> storage.add(getSkeletonTypeMeta(2)));
// Zombies
mapEntityTypeWithData(Entity1_11Types.EntityType.HUSK, Entity1_11Types.EntityType.ZOMBIE).mobName("Husk").spawnMetadata(storage -> handleZombieType(storage, 6));
mapEntityTypeWithData(Entity1_11Types.EntityType.HUSK, Entity1_11Types.EntityType.ZOMBIE).plainName().spawnMetadata(storage -> handleZombieType(storage, 6));
mapEntityTypeWithData(Entity1_11Types.EntityType.ZOMBIE_VILLAGER, Entity1_11Types.EntityType.ZOMBIE).spawnMetadata(storage -> handleZombieType(storage, 1));
// Horses
mapEntityTypeWithData(Entity1_11Types.EntityType.HORSE, Entity1_11Types.EntityType.HORSE).spawnMetadata(storage -> storage.add(getHorseMetaType(0))); // Nob able to ride the horse without having the MetaType sent.
@@ -228,10 +228,10 @@ public class EntityPackets1_11 extends LegacyEntityRewriter<Protocol1_10To1_11>
mapEntityTypeWithData(Entity1_11Types.EntityType.ZOMBIE_HORSE, Entity1_11Types.EntityType.HORSE).spawnMetadata(storage -> storage.add(getHorseMetaType(3)));
// New mobs
mapEntityTypeWithData(Entity1_11Types.EntityType.EVOCATION_FANGS, Entity1_11Types.EntityType.SHULKER);
mapEntityTypeWithData(Entity1_11Types.EntityType.EVOCATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).mobName("Evoker");
mapEntityTypeWithData(Entity1_11Types.EntityType.VEX, Entity1_11Types.EntityType.BAT).mobName("Vex");
mapEntityTypeWithData(Entity1_11Types.EntityType.VINDICATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).mobName("Vindicator").spawnMetadata(storage -> storage.add(new Metadata(13, MetaType1_9.VarInt, 4))); // Base Profession
mapEntityTypeWithData(Entity1_11Types.EntityType.LIAMA, Entity1_11Types.EntityType.HORSE).mobName("Llama").spawnMetadata(storage -> storage.add(getHorseMetaType(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.EVOCATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).plainName();
mapEntityTypeWithData(Entity1_11Types.EntityType.VEX, Entity1_11Types.EntityType.BAT).plainName();
mapEntityTypeWithData(Entity1_11Types.EntityType.VINDICATION_ILLAGER, Entity1_11Types.EntityType.VILLAGER).plainName().spawnMetadata(storage -> storage.add(new Metadata(13, MetaType1_9.VarInt, 4))); // Base Profession
mapEntityTypeWithData(Entity1_11Types.EntityType.LIAMA, Entity1_11Types.EntityType.HORSE).plainName().spawnMetadata(storage -> storage.add(getHorseMetaType(1)));
mapEntityTypeWithData(Entity1_11Types.EntityType.LIAMA_SPIT, Entity1_11Types.EntityType.SNOWBALL);
mapObjectType(Entity1_11Types.ObjectType.LIAMA_SPIT, Entity1_11Types.ObjectType.SNOWBALL, -1);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,6 +19,7 @@
package com.viaversion.viabackwards.protocol.protocol1_11_1to1_12;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.api.data.BackwardsMappings;
import com.viaversion.viabackwards.protocol.protocol1_11_1to1_12.data.ShoulderTracker;
import com.viaversion.viabackwards.protocol.protocol1_11_1to1_12.packets.BlockItemPackets1_12;
import com.viaversion.viabackwards.protocol.protocol1_11_1to1_12.packets.ChatPackets1_12;
@@ -39,6 +40,12 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.Protocol1_9To1_8;
public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_12, ClientboundPackets1_9_3, ServerboundPackets1_12, ServerboundPackets1_9_3> {
private static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.12", "1.11", null, true) {
@Override
protected boolean shouldWarnOnMissing(final String key) {
return super.shouldWarnOnMissing(key) && !key.equals("sounds");
}
};
private final EntityPackets1_12 entityPackets = new EntityPackets1_12(this);
private final BlockItemPackets1_12 blockItemPackets = new BlockItemPackets1_12(this);
@@ -83,6 +90,11 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_
user.put(new ShoulderTracker(user));
}
@Override
public BackwardsMappings getMappingData() {
return MAPPINGS;
}
@Override
public EntityPackets1_12 getEntityRewriter() {
return entityPackets;
@@ -92,4 +104,9 @@ public class Protocol1_11_1To1_12 extends BackwardsProtocol<ClientboundPackets1_
public BlockItemPackets1_12 getItemRewriter() {
return blockItemPackets;
}
@Override
public boolean hasMappingDataToLoad() {
return true;
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ import com.viaversion.viaversion.libs.fastutil.ints.Int2IntMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2IntOpenHashMap;
public class MapColorMapping {
private static final Int2IntMap MAPPING = new Int2IntOpenHashMap(64, 1F);
private static final Int2IntMap MAPPING = new Int2IntOpenHashMap(64, 0.99F);
static {
MAPPING.defaultReturnValue(-1);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -145,7 +145,7 @@ public class BlockItemPackets1_12 extends LegacyBlockItemRewriter<Protocol1_11_1
// Apologize (may happen in some cases, maybe if inventory is full?)
PacketWrapper confirm = wrapper.create(ServerboundPackets1_12.WINDOW_CONFIRMATION);
confirm.write(Type.BYTE, wrapper.get(Type.UNSIGNED_BYTE, 0).byteValue());
confirm.write(Type.UNSIGNED_BYTE, wrapper.get(Type.UNSIGNED_BYTE, 0));
confirm.write(Type.SHORT, wrapper.get(Type.SHORT, 1));
confirm.write(Type.BOOLEAN, false); // Success - not used
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -212,8 +212,8 @@ public class EntityPackets1_12 extends LegacyEntityRewriter<Protocol1_11_1To1_12
@Override
protected void registerRewrites() {
mapEntityTypeWithData(Entity1_12Types.EntityType.PARROT, Entity1_12Types.EntityType.BAT).mobName("Parrot").spawnMetadata(storage -> storage.add(new Metadata(12, MetaType1_12.Byte, (byte) 0x00)));
mapEntityTypeWithData(Entity1_12Types.EntityType.ILLUSION_ILLAGER, Entity1_12Types.EntityType.EVOCATION_ILLAGER).mobName("Illusioner");
mapEntityTypeWithData(Entity1_12Types.EntityType.PARROT, Entity1_12Types.EntityType.BAT).plainName().spawnMetadata(storage -> storage.add(new Metadata(12, MetaType1_12.Byte, (byte) 0x00)));
mapEntityTypeWithData(Entity1_12Types.EntityType.ILLUSION_ILLAGER, Entity1_12Types.EntityType.EVOCATION_ILLAGER).plainName();
// Handle Illager
filter().filterFamily(Entity1_12Types.EntityType.EVOCATION_ILLAGER).cancel(12);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ import com.viaversion.viaversion.util.Pair;
public class FlowerPotHandler implements BackwardsBlockEntityProvider.BackwardsBlockEntityHandler {
private static final Int2ObjectMap<Pair<String, Byte>> FLOWERS = new Int2ObjectOpenHashMap<>(22, 1F);
private static final Int2ObjectMap<Pair<String, Byte>> FLOWERS = new Int2ObjectOpenHashMap<>(22, 0.99F);
private static final Pair<String, Byte> AIR = new Pair<>("minecraft:air", (byte) 0);
static {
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -41,7 +41,6 @@ import java.util.Map;
public class BackwardsMappings extends com.viaversion.viabackwards.api.data.BackwardsMappings {
private final Int2ObjectMap<String> statisticMappings = new Int2ObjectOpenHashMap<>();
private final Map<String, String> translateMappings = new HashMap<>();
private Mappings enchantmentMappings;
public BackwardsMappings() {
super("1.13", "1.12", Protocol1_13To1_12_2.class, true);
@@ -49,7 +48,8 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
@Override
public void loadVBExtras(JsonObject oldMappings, JsonObject newMappings) {
enchantmentMappings = new VBMappings(oldMappings.getAsJsonObject("enchantments"), newMappings.getAsJsonObject("enchantments"), false);
enchantmentMappings = VBMappings.vbBuilder().warnOnMissing(false)
.unmapped(oldMappings.getAsJsonArray("enchantments")).mapped(newMappings.getAsJsonObject("legacy_enchantments")).build();
for (Map.Entry<String, Integer> entry : StatisticMappings.CUSTOM_STATS.entrySet()) {
statisticMappings.put(entry.getValue().intValue(), entry.getKey());
}
@@ -60,7 +60,7 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
// Has lots of compat layers, so we can't use the default Via method
private static void mapIdentifiers(int[] output, JsonObject newIdentifiers, JsonObject oldIdentifiers, JsonObject mapping) {
Object2IntMap newIdentifierMap = MappingDataLoader.indexedObjectToMap(oldIdentifiers);
Object2IntMap<String> newIdentifierMap = MappingDataLoader.indexedObjectToMap(oldIdentifiers);
for (Map.Entry<String, JsonElement> entry : newIdentifiers.entrySet()) {
String key = entry.getValue().getAsString();
int value = newIdentifierMap.getInt(key);
@@ -101,7 +101,7 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
int[] oldToNew = new int[8582];
Arrays.fill(oldToNew, -1);
mapIdentifiers(oldToNew, oldMappings.getAsJsonObject("blockstates"), newMappings.getAsJsonObject("blocks"), diffMappings.getAsJsonObject("blockstates"));
return new IntArrayMappings(oldToNew);
return IntArrayMappings.of(oldToNew, -1);
} else {
return super.loadFromObject(oldMappings, newMappings, diffMappings, key);
}
@@ -144,8 +144,4 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back
public Map<String, String> getTranslateMappings() {
return translateMappings;
}
public Mappings getEnchantmentMappings() {
return enchantmentMappings;
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectMap;
import com.viaversion.viaversion.libs.fastutil.ints.Int2ObjectOpenHashMap;
public class PaintingMapping {
private static final Int2ObjectMap<String> PAINTINGS = new Int2ObjectOpenHashMap<>(26, 1F);
private static final Int2ObjectMap<String> PAINTINGS = new Int2ObjectOpenHashMap<>(26, 0.99F);
public static void init() {
add("Kebab");
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
private final String extraNbtTag;
public BlockItemPackets1_13(Protocol1_12_2To1_13 protocol) {
super(protocol, null);
super(protocol);
extraNbtTag = "VB|" + protocol.getClass().getSimpleName() + "|2";
}
@@ -91,21 +91,20 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
protocol.registerClientbound(ClientboundPackets1_13.COOLDOWN, new PacketRemapper() {
@Override
public void registerMap() {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
int itemId = wrapper.read(Type.VAR_INT);
int oldId = protocol.getMappingData().getItemMappings().get(itemId);
if (oldId != -1) {
Optional<String> eggEntityId = SpawnEggRewriter.getEntityId(oldId);
if (eggEntityId.isPresent()) {
itemId = 383 << 16;
} else {
itemId = (oldId >> 4) << 16 | oldId & 0xF;
}
}
wrapper.write(Type.VAR_INT, itemId);
handler(wrapper -> {
int itemId = wrapper.read(Type.VAR_INT);
int oldId = protocol.getMappingData().getItemMappings().get(itemId);
if (oldId == -1) {
wrapper.cancel();
return;
}
if (SpawnEggRewriter.getEntityId(oldId).isPresent()) {
wrapper.write(Type.VAR_INT, 383 << 4);
return;
}
wrapper.write(Type.VAR_INT, oldId >> 4);
});
}
});
@@ -654,10 +653,17 @@ public class BlockItemPackets1_13 extends com.viaversion.viabackwards.api.rewrit
for (Tag enchantmentEntryTag : enchantments.clone()) {
CompoundTag enchantmentEntry = (CompoundTag) enchantmentEntryTag;
Tag idTag = enchantmentEntry.get("id");
if (!(idTag instanceof StringTag)) continue;
if (!(idTag instanceof StringTag)) {
continue;
}
String newId = (String) idTag.getValue();
int levelValue = ((NumberTag) enchantmentEntry.get("lvl")).asInt();
NumberTag levelTag = enchantmentEntry.get("lvl");
if (levelTag == null) {
continue;
}
int levelValue = levelTag.asInt();
short level = levelValue < Short.MAX_VALUE ? (short) levelValue : Short.MAX_VALUE;
String mappedEnchantmentId = enchantmentMappings.get(newId);
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -281,25 +281,25 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
@Override
protected void registerRewrites() {
// Rewrite new Entity 'drowned'
mapEntityTypeWithData(Entity1_13Types.EntityType.DROWNED, Entity1_13Types.EntityType.ZOMBIE_VILLAGER).mobName("Drowned");
mapEntityTypeWithData(Entity1_13Types.EntityType.DROWNED, Entity1_13Types.EntityType.ZOMBIE_VILLAGER).plainName();
// Fishy
mapEntityTypeWithData(Entity1_13Types.EntityType.COD, Entity1_13Types.EntityType.SQUID).mobName("Cod");
mapEntityTypeWithData(Entity1_13Types.EntityType.SALMON, Entity1_13Types.EntityType.SQUID).mobName("Salmon");
mapEntityTypeWithData(Entity1_13Types.EntityType.PUFFERFISH, Entity1_13Types.EntityType.SQUID).mobName("Puffer Fish");
mapEntityTypeWithData(Entity1_13Types.EntityType.TROPICAL_FISH, Entity1_13Types.EntityType.SQUID).mobName("Tropical Fish");
mapEntityTypeWithData(Entity1_13Types.EntityType.COD, Entity1_13Types.EntityType.SQUID).plainName();
mapEntityTypeWithData(Entity1_13Types.EntityType.SALMON, Entity1_13Types.EntityType.SQUID).plainName();
mapEntityTypeWithData(Entity1_13Types.EntityType.PUFFERFISH, Entity1_13Types.EntityType.SQUID).plainName();
mapEntityTypeWithData(Entity1_13Types.EntityType.TROPICAL_FISH, Entity1_13Types.EntityType.SQUID).plainName();
// Phantom
mapEntityTypeWithData(Entity1_13Types.EntityType.PHANTOM, Entity1_13Types.EntityType.PARROT).mobName("Phantom").spawnMetadata(storage -> {
mapEntityTypeWithData(Entity1_13Types.EntityType.PHANTOM, Entity1_13Types.EntityType.PARROT).plainName().spawnMetadata(storage -> {
// The phantom is grey/blue so let's do yellow/blue
storage.add(new Metadata(15, MetaType1_12.VarInt, 3));
});
// Dolphin
mapEntityTypeWithData(Entity1_13Types.EntityType.DOLPHIN, Entity1_13Types.EntityType.SQUID).mobName("Dolphin");
mapEntityTypeWithData(Entity1_13Types.EntityType.DOLPHIN, Entity1_13Types.EntityType.SQUID).plainName();
// Turtle
mapEntityTypeWithData(Entity1_13Types.EntityType.TURTLE, Entity1_13Types.EntityType.OCELOT).mobName("Turtle");
mapEntityTypeWithData(Entity1_13Types.EntityType.TURTLE, Entity1_13Types.EntityType.OCELOT).plainName();
// Rewrite Meta types
filter().handler((event, meta) -> {
@@ -328,7 +328,6 @@ public class EntityPackets1_13 extends LegacyEntityRewriter<Protocol1_12_2To1_13
typeId - 1
));
}
});
// Rewrite Custom Name from Chat to String
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -17,10 +17,8 @@
*/
package com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.packets;
import com.viaversion.viabackwards.ViaBackwards;
import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.Protocol1_12_2To1_13;
import com.viaversion.viabackwards.protocol.protocol1_12_2to1_13.data.NamedSoundMapping;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.rewriter.RewriterBase;
import com.viaversion.viaversion.api.type.Type;
@@ -39,14 +37,13 @@ public class SoundPackets1_13 extends RewriterBase<Protocol1_12_2To1_13> {
protocol.registerClientbound(ClientboundPackets1_13.NAMED_SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING);
handler(wrapper -> {
String newSound = wrapper.get(Type.STRING, 0);
String oldSound = NamedSoundMapping.getOldId(newSound);
if (oldSound != null || (oldSound = protocol.getMappingData().getMappedNamedSound(newSound)) != null) {
wrapper.set(Type.STRING, 0, oldSound);
} else if (!Via.getConfig().isSuppressConversionWarnings()) {
ViaBackwards.getPlatform().getLogger().warning("Unknown named sound in 1.13->1.12 protocol: " + newSound);
String sound = wrapper.read(Type.STRING);
String mappedSound = NamedSoundMapping.getOldId(sound);
if (mappedSound != null || (mappedSound = protocol.getMappingData().getMappedNamedSound(sound)) != null) {
wrapper.write(Type.STRING, mappedSound);
} else {
wrapper.write(Type.STRING, sound);
}
});
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -33,6 +33,7 @@ import com.viaversion.viaversion.api.platform.providers.Provider;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.IntTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.StringTag;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.Tag;
import java.util.HashMap;
import java.util.Map;
@@ -67,7 +68,12 @@ public class BackwardsBlockEntityProvider implements Provider {
* @param tag The block entity tag
*/
public CompoundTag transform(UserConnection user, Position position, CompoundTag tag) throws Exception {
String id = (String) tag.get("id").getValue();
final Tag idTag = tag.get("id");
if (!(idTag instanceof StringTag)) {
return tag;
}
String id = (String) idTag.getValue();
BackwardsBlockEntityHandler handler = handlers.get(id);
if (handler == null) {
if (Via.getManager().isDebug()) {
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -19,8 +19,6 @@ package com.viaversion.viabackwards.protocol.protocol1_13_1to1_13_2.packets;
import com.viaversion.viabackwards.protocol.protocol1_13_1to1_13_2.Protocol1_13_1To1_13_2;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_13;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_13_2;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
@@ -54,9 +52,7 @@ public class EntityPackets1_13_2 {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
for (Metadata metadata : wrapper.get(Types1_13.METADATA_LIST, 0)) {
if (metadata.metaType() == MetaType1_13_2.Slot) {
metadata.setMetaType(MetaType1_13.Slot);
}
metadata.setMetaType(Types1_13.META_TYPES.byId(metadata.metaType().typeId()));
}
}
});
@@ -79,9 +75,7 @@ public class EntityPackets1_13_2 {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
for (Metadata metadata : wrapper.get(Types1_13.METADATA_LIST, 0)) {
if (metadata.metaType() == MetaType1_13_2.Slot) {
metadata.setMetaType(MetaType1_13.Slot);
}
metadata.setMetaType(Types1_13.META_TYPES.byId(metadata.metaType().typeId()));
}
}
});
@@ -98,9 +92,7 @@ public class EntityPackets1_13_2 {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
for (Metadata metadata : wrapper.get(Types1_13.METADATA_LIST, 0)) {
if (metadata.metaType() == MetaType1_13_2.Slot) {
metadata.setMetaType(MetaType1_13.Slot);
}
metadata.setMetaType(Types1_13.META_TYPES.byId(metadata.metaType().typeId()));
}
}
});
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@ import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.packets.EntityP
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.packets.PlayerPackets1_14;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.packets.SoundPackets1_14;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.ChunkLightStorage;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.DifficultyStorage;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.entities.Entity1_14Types;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
@@ -46,6 +47,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
public static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.14", "1.13.2", Protocol1_14To1_13_2.class, true);
private final EntityRewriter entityRewriter = new EntityPackets1_14(this);
private final TranslatableRewriter translatableRewriter = new TranslatableRewriter(this);
private BlockItemPackets1_14 blockItemPackets;
public Protocol1_13_2To1_14() {
@@ -56,7 +58,6 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
protected void registerPackets() {
executeAsyncAfterLoaded(Protocol1_14To1_13_2.class, MAPPINGS::load);
TranslatableRewriter translatableRewriter = new TranslatableRewriter(this);
translatableRewriter.registerBossBar(ClientboundPackets1_14.BOSSBAR);
translatableRewriter.registerChatMessage(ClientboundPackets1_14.CHAT_MESSAGE);
translatableRewriter.registerCombatEvent(ClientboundPackets1_14.COMBAT_EVENT);
@@ -67,7 +68,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
new CommandRewriter1_14(this).registerDeclareCommands(ClientboundPackets1_14.DECLARE_COMMANDS);
blockItemPackets = new BlockItemPackets1_14(this, translatableRewriter);
blockItemPackets = new BlockItemPackets1_14(this);
blockItemPackets.register();
entityRewriter.register();
new PlayerPackets1_14(this).register();
@@ -170,6 +171,7 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
wrapper.read(Type.BYTE_ARRAY_PRIMITIVE);
}
//TODO Soft memory leak: Don't store light if chunk is already loaded
wrapper.user().get(ChunkLightStorage.class).setStoredLight(skyLight, blockLight, x, z);
wrapper.cancel();
}
@@ -194,6 +196,8 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
if (!user.has(ChunkLightStorage.class)) {
user.put(new ChunkLightStorage(user));
}
user.put(new DifficultyStorage(user));
}
@Override
@@ -210,4 +214,9 @@ public class Protocol1_13_2To1_14 extends BackwardsProtocol<ClientboundPackets1_
public BlockItemPackets1_14 getItemRewriter() {
return blockItemPackets;
}
@Override
public TranslatableRewriter getTranslatableRewriter() {
return translatableRewriter;
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@ public class CommandRewriter1_14 extends CommandRewriter {
}
@Override
protected @Nullable String handleArgumentType(String argumentType) {
public @Nullable String handleArgumentType(String argumentType) {
switch (argumentType) {
case "minecraft:nbt_compound_tag":
return "minecraft:nbt";
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,7 +20,6 @@ package com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.packets;
import com.google.common.collect.ImmutableSet;
import com.viaversion.viabackwards.ViaBackwards;
import com.viaversion.viabackwards.api.rewriters.EnchantmentRewriter;
import com.viaversion.viabackwards.api.rewriters.TranslatableRewriter;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.ChunkLightStorage;
import com.viaversion.viaversion.api.Via;
@@ -33,12 +32,12 @@ import com.viaversion.viaversion.api.minecraft.entities.Entity1_14Types;
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_13_2;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.types.version.Types1_13;
import com.viaversion.viaversion.api.type.types.version.Types1_13_2;
import com.viaversion.viaversion.libs.gson.JsonElement;
import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
@@ -65,8 +64,8 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
private EnchantmentRewriter enchantmentRewriter;
public BlockItemPackets1_14(Protocol1_13_2To1_14 protocol, TranslatableRewriter translatableRewriter) {
super(protocol, translatableRewriter);
public BlockItemPackets1_14(Protocol1_13_2To1_14 protocol) {
super(protocol);
}
@Override
@@ -284,12 +283,11 @@ public class BlockItemPackets1_14 extends com.viaversion.viabackwards.api.rewrit
Item item = wrapper.read(Type.FLAT_VAR_INT_ITEM);
int armorType = item == null || item.identifier() == 0 ? 0 : item.identifier() - 726;
if (armorType < 0 || armorType > 3) {
ViaBackwards.getPlatform().getLogger().warning("Received invalid horse armor: " + item);
wrapper.cancel();
return;
}
List<Metadata> metadataList = new ArrayList<>();
metadataList.add(new Metadata(16, MetaType1_13_2.VarInt, armorType));
metadataList.add(new Metadata(16, Types1_13_2.META_TYPES.varIntType, armorType));
wrapper.write(Types1_13.METADATA_LIST, metadataList);
}
}
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@ import com.viaversion.viabackwards.api.entities.storage.EntityPositionHandler;
import com.viaversion.viabackwards.api.rewriters.LegacyEntityRewriter;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.ChunkLightStorage;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.DifficultyStorage;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.EntityPositionStorage1_14;
import com.viaversion.viaversion.api.data.entity.EntityTracker;
import com.viaversion.viaversion.api.minecraft.Position;
@@ -33,7 +34,6 @@ import com.viaversion.viaversion.api.minecraft.entities.EntityType;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.minecraft.metadata.MetaType;
import com.viaversion.viaversion.api.minecraft.metadata.Metadata;
import com.viaversion.viaversion.api.minecraft.metadata.types.MetaType1_13_2;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper;
@@ -51,7 +51,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
private EntityPositionHandler positionHandler;
public EntityPackets1_14(Protocol1_13_2To1_14 protocol) {
super(protocol, MetaType1_13_2.OptChat, MetaType1_13_2.Boolean);
super(protocol, Types1_13_2.META_TYPES.optionalComponentType, Types1_13_2.META_TYPES.booleanType);
}
//TODO work the method into this class alone
@@ -310,15 +310,19 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
handler(getTrackerHandler(Entity1_14Types.PLAYER, Type.INT));
handler(getDimensionHandler(1));
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
wrapper.write(Type.UNSIGNED_BYTE, (short) 0);
handler(wrapper -> {
short difficulty = wrapper.user().get(DifficultyStorage.class).getDifficulty();
wrapper.write(Type.UNSIGNED_BYTE, difficulty);
wrapper.passthrough(Type.UNSIGNED_BYTE); // Max Players
wrapper.passthrough(Type.STRING); // Level Type
wrapper.read(Type.VAR_INT); // Read View Distance
}
wrapper.passthrough(Type.UNSIGNED_BYTE); // Max Players
wrapper.passthrough(Type.STRING); // Level Type
wrapper.read(Type.VAR_INT); // Read View Distance
//TODO Track client position
// Manually add position storage
/*int entitiyId = wrapper.get(Type.INT, 0);
StoredEntityData storedEntity = protocol.getEntityRewriter().tracker(wrapper.user()).entityData(entitiyId);
storedEntity.put(new EntityPositionStorage1_14());*/
});
}
});
@@ -328,16 +332,15 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
public void registerMap() {
map(Type.INT); // 0 - Dimension ID
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
int dimensionId = wrapper.get(Type.INT, 0);
clientWorld.setEnvironment(dimensionId);
handler(wrapper -> {
ClientWorld clientWorld = wrapper.user().get(ClientWorld.class);
int dimensionId = wrapper.get(Type.INT, 0);
clientWorld.setEnvironment(dimensionId);
wrapper.write(Type.UNSIGNED_BYTE, (short) 0); // Difficulty
wrapper.user().get(ChunkLightStorage.class).clear();
}
short difficulty = wrapper.user().get(DifficultyStorage.class).getDifficulty();
wrapper.write(Type.UNSIGNED_BYTE, difficulty);
wrapper.user().get(ChunkLightStorage.class).clear();
});
}
});
@@ -347,30 +350,29 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
protected void registerRewrites() {
mapTypes(Entity1_14Types.values(), Entity1_13Types.EntityType.class);
mapEntityTypeWithData(Entity1_14Types.CAT, Entity1_14Types.OCELOT).jsonName("Cat");
mapEntityTypeWithData(Entity1_14Types.TRADER_LLAMA, Entity1_14Types.LLAMA).jsonName("Trader Llama");
mapEntityTypeWithData(Entity1_14Types.FOX, Entity1_14Types.WOLF).jsonName("Fox");
mapEntityTypeWithData(Entity1_14Types.PANDA, Entity1_14Types.POLAR_BEAR).jsonName("Panda");
mapEntityTypeWithData(Entity1_14Types.PILLAGER, Entity1_14Types.VILLAGER).jsonName("Pillager");
mapEntityTypeWithData(Entity1_14Types.WANDERING_TRADER, Entity1_14Types.VILLAGER).jsonName("Wandering Trader");
mapEntityTypeWithData(Entity1_14Types.RAVAGER, Entity1_14Types.COW).jsonName("Ravager");
mapEntityTypeWithData(Entity1_14Types.CAT, Entity1_14Types.OCELOT).jsonName();
mapEntityTypeWithData(Entity1_14Types.TRADER_LLAMA, Entity1_14Types.LLAMA).jsonName();
mapEntityTypeWithData(Entity1_14Types.FOX, Entity1_14Types.WOLF).jsonName();
mapEntityTypeWithData(Entity1_14Types.PANDA, Entity1_14Types.POLAR_BEAR).jsonName();
mapEntityTypeWithData(Entity1_14Types.PILLAGER, Entity1_14Types.VILLAGER).jsonName();
mapEntityTypeWithData(Entity1_14Types.WANDERING_TRADER, Entity1_14Types.VILLAGER).jsonName();
mapEntityTypeWithData(Entity1_14Types.RAVAGER, Entity1_14Types.COW).jsonName();
filter().handler((event, meta) -> {
int typeId = meta.metaType().typeId();
if (typeId <= 15) {
meta.setMetaType(MetaType1_13_2.byId(typeId));
meta.setMetaType(Types1_13_2.META_TYPES.byId(typeId));
}
MetaType type = meta.metaType();
if (type == MetaType1_13_2.Slot) {
if (type == Types1_13_2.META_TYPES.itemType) {
Item item = (Item) meta.getValue();
meta.setValue(protocol.getItemRewriter().handleItemToClient(item));
} else if (type == MetaType1_13_2.BlockID) {
int blockstate = (Integer) meta.getValue();
} else if (type == Types1_13_2.META_TYPES.blockStateType) {
int blockstate = meta.value();
meta.setValue(protocol.getMappingData().getNewBlockStateId(blockstate));
}
});
filter().type(Entity1_14Types.PILLAGER).cancel(15);
@@ -409,7 +411,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
});
filter().type(Entity1_14Types.FIREWORK_ROCKET).index(8).handler((event, meta) -> {
meta.setMetaType(MetaType1_13_2.VarInt);
meta.setMetaType(Types1_13_2.META_TYPES.varIntType);
Integer value = (Integer) meta.getValue();
if (value == null) {
meta.setValue(0);
@@ -422,7 +424,7 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
MetaHandler villagerDataHandler = (event, meta) -> {
VillagerData villagerData = (VillagerData) meta.getValue();
meta.setTypeAndValue(MetaType1_13_2.VarInt, villagerDataToProfession(villagerData));
meta.setTypeAndValue(Types1_13_2.META_TYPES.varIntType, villagerDataToProfession(villagerData));
if (meta.id() == 16) {
event.setIndex(15); // decreased by 2 again in one of the following handlers
}
@@ -435,13 +437,13 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
filter().filterFamily(Entity1_14Types.ABSTRACT_SKELETON).index(13).handler((event, meta) -> {
byte value = (byte) meta.getValue();
if ((value & 4) != 0) {
event.createExtraMeta(new Metadata(14, MetaType1_13_2.Boolean, true));
event.createExtraMeta(new Metadata(14, Types1_13_2.META_TYPES.booleanType, true));
}
});
filter().filterFamily(Entity1_14Types.ZOMBIE).index(13).handler((event, meta) -> {
byte value = (byte) meta.getValue();
if ((value & 4) != 0) {
event.createExtraMeta(new Metadata(16, MetaType1_13_2.Boolean, true));
event.createExtraMeta(new Metadata(16, Types1_13_2.META_TYPES.booleanType, true));
}
});
@@ -471,12 +473,12 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
}
});
// Something
// Pose
filter().removeIndex(6);
filter().type(Entity1_14Types.OCELOT).index(13).handler((event, meta) -> {
event.setIndex(15);
meta.setTypeAndValue(MetaType1_13_2.VarInt, 0);
meta.setTypeAndValue(Types1_13_2.META_TYPES.varIntType, 0);
});
filter().type(Entity1_14Types.CAT).handler((event, meta) -> {
@@ -486,6 +488,12 @@ public class EntityPackets1_14 extends LegacyEntityRewriter<Protocol1_13_2To1_14
meta.setValue((byte) ((byte) meta.getValue() & 0x4));
}
});
filter().handler((event, meta) -> {
if (meta.metaType().typeId() > 15) {
throw new IllegalArgumentException("Unhandled metadata: " + meta);
}
});
}
public int villagerDataToProfession(VillagerData data) {
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
package com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.packets;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.Protocol1_13_2To1_14;
import com.viaversion.viabackwards.protocol.protocol1_13_2to1_14.storage.DifficultyStorage;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.remapper.PacketHandler;
@@ -40,6 +41,10 @@ public class PlayerPackets1_14 extends RewriterBase<Protocol1_13_2To1_14> {
public void registerMap() {
map(Type.UNSIGNED_BYTE);
map(Type.BOOLEAN, Type.NOTHING); // Locked
handler(wrapper -> {
byte difficulty = wrapper.get(Type.UNSIGNED_BYTE, 0).byteValue();
wrapper.user().get(DifficultyStorage.class).setDifficulty(difficulty);
});
}
});
@@ -59,9 +64,8 @@ public class PlayerPackets1_14 extends RewriterBase<Protocol1_13_2To1_14> {
protocol.registerServerbound(ServerboundPackets1_13.PLAYER_DIGGING, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT);
map(Type.POSITION, Type.POSITION1_14);
map(Type.BYTE);
map(Type.VAR_INT); // Action
map(Type.POSITION, Type.POSITION1_14); // Position
}
});
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1,6 +1,6 @@
/*
* This file is part of ViaBackwards - https://github.com/ViaVersion/ViaBackwards
* Copyright (C) 2016-2021 ViaVersion and contributors
* Copyright (C) 2016-2022 ViaVersion and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Loaded 100 of 194 files, more files were not shown because too many files have changed in this diff. Show more