Hacky merge of version/7.2.x

This commit is contained in:
Octavia Togami 2023-10-04 23:51:51 -07:00
parent 375bf84a7e
commit dc0ae906cd
No known key found for this signature in database
GPG Key ID: CC364524D1983C99
3 changed files with 122 additions and 117 deletions

View File

@ -1,3 +1,9 @@
7.2.16
- Update to 1.20.2
- Fixed an issue with the legacy spawner|mobname syntax not setting mobs correctly on initial spawn
- Added a workaround for situations where clients incorrectly send multiple clicks for a single click
- Fixed some situations where //fillr might fail when Y is less than 0
7.2.15
- [Forge] Fix a bug preventing Forge clients lacking WorldEdit from joining Forge servers with WorldEdit in some cases
- [Forge] Added Console and CommandBlock support

View File

@ -213,8 +213,8 @@ public PaperweightAdapter() throws NoSuchFieldException, NoSuchMethodException {
CraftServer.class.cast(Bukkit.getServer());
int dataVersion = CraftMagicNumbers.INSTANCE.getDataVersion();
if (dataVersion != 3463 && dataVersion != 3465) {
throw new UnsupportedClassVersionError("Not 1.20(.1)!");
if (dataVersion != 3578) {
throw new UnsupportedClassVersionError("Not 1.20.2!");
}
serverWorldsField = CraftServer.class.getDeclaredField("worlds");

View File

@ -29,7 +29,6 @@
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.mojang.datafixers.DSL;
import com.mojang.datafixers.DSL.TypeReference;
import com.mojang.datafixers.DataFixer;
import com.mojang.datafixers.DataFixerBuilder;
@ -103,50 +102,50 @@ public <T> T fixUp(FixType<T> type, T original, int srcVer) {
}
private LinCompoundTag fixChunk(LinCompoundTag originalChunk, int srcVer) {
net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) adapter.fromNative(originalChunk);
net.minecraft.nbt.CompoundTag fixed = convert(LegacyType.CHUNK, tag, srcVer);
CompoundTag tag = (CompoundTag) adapter.fromNative(originalChunk);
CompoundTag fixed = convert(LegacyType.CHUNK, tag, srcVer);
return (LinCompoundTag) adapter.toNative(fixed);
}
private LinCompoundTag fixBlockEntity(LinCompoundTag origTileEnt, int srcVer) {
net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) adapter.fromNative(origTileEnt);
net.minecraft.nbt.CompoundTag fixed = convert(LegacyType.BLOCK_ENTITY, tag, srcVer);
CompoundTag tag = (CompoundTag) adapter.fromNative(origTileEnt);
CompoundTag fixed = convert(LegacyType.BLOCK_ENTITY, tag, srcVer);
return (LinCompoundTag) adapter.toNative(fixed);
}
private LinCompoundTag fixEntity(LinCompoundTag origEnt, int srcVer) {
net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) adapter.fromNative(origEnt);
net.minecraft.nbt.CompoundTag fixed = convert(LegacyType.ENTITY, tag, srcVer);
CompoundTag tag = (CompoundTag) adapter.fromNative(origEnt);
CompoundTag fixed = convert(LegacyType.ENTITY, tag, srcVer);
return (LinCompoundTag) adapter.toNative(fixed);
}
private String fixBlockState(String blockState, int srcVer) {
net.minecraft.nbt.CompoundTag stateNBT = stateToNBT(blockState);
CompoundTag stateNBT = stateToNBT(blockState);
Dynamic<Tag> dynamic = new Dynamic<>(OPS_NBT, stateNBT);
net.minecraft.nbt.CompoundTag fixed = (net.minecraft.nbt.CompoundTag) INSTANCE.fixer.update(References.BLOCK_STATE, dynamic, srcVer, DATA_VERSION).getValue();
CompoundTag fixed = (CompoundTag) INSTANCE.fixer.update(References.BLOCK_STATE, dynamic, srcVer, DATA_VERSION).getValue();
return nbtToState(fixed);
}
private String nbtToState(net.minecraft.nbt.CompoundTag tagCompound) {
private String nbtToState(CompoundTag tagCompound) {
StringBuilder sb = new StringBuilder();
sb.append(tagCompound.getString("Name"));
if (tagCompound.contains("Properties", 10)) {
sb.append('[');
net.minecraft.nbt.CompoundTag props = tagCompound.getCompound("Properties");
CompoundTag props = tagCompound.getCompound("Properties");
sb.append(props.getAllKeys().stream().map(k -> k + "=" + props.getString(k).replace("\"", "")).collect(Collectors.joining(",")));
sb.append(']');
}
return sb.toString();
}
private static net.minecraft.nbt.CompoundTag stateToNBT(String blockState) {
private static CompoundTag stateToNBT(String blockState) {
int propIdx = blockState.indexOf('[');
net.minecraft.nbt.CompoundTag tag = new net.minecraft.nbt.CompoundTag();
CompoundTag tag = new CompoundTag();
if (propIdx < 0) {
tag.putString("Name", blockState);
} else {
tag.putString("Name", blockState.substring(0, propIdx));
net.minecraft.nbt.CompoundTag propTag = new net.minecraft.nbt.CompoundTag();
CompoundTag propTag = new CompoundTag();
String props = blockState.substring(propIdx + 1, blockState.length() - 1);
String[] propArr = props.split(",");
for (String pair : propArr) {
@ -224,7 +223,7 @@ public DataFixer buildUnoptimized() {
}
@Override
public DataFixer buildOptimized(final Set<DSL.TypeReference> requiredTypes, Executor executor) {
public DataFixer buildOptimized(final Set<TypeReference> requiredTypes, Executor executor) {
return buildUnoptimized();
}
@ -240,7 +239,7 @@ private class WrappedDataFixer implements DataFixer {
public <T> Dynamic<T> update(TypeReference type, Dynamic<T> dynamic, int sourceVer, int targetVer) {
LegacyType legacyType = DFU_TO_LEGACY.get(type.typeName());
if (sourceVer < LEGACY_VERSION && legacyType != null) {
net.minecraft.nbt.CompoundTag cmp = (net.minecraft.nbt.CompoundTag) dynamic.getValue();
CompoundTag cmp = (CompoundTag) dynamic.getValue();
int desiredVersion = Math.min(targetVer, LEGACY_VERSION);
cmp = convert(legacyType, cmp, sourceVer, desiredVersion);
@ -250,7 +249,7 @@ public <T> Dynamic<T> update(TypeReference type, Dynamic<T> dynamic, int sourceV
return realFixer.update(type, dynamic, sourceVer, targetVer);
}
private net.minecraft.nbt.CompoundTag convert(LegacyType type, net.minecraft.nbt.CompoundTag cmp, int sourceVer, int desiredVersion) {
private CompoundTag convert(LegacyType type, CompoundTag cmp, int sourceVer, int desiredVersion) {
List<DataConverter> converters = PaperweightDataConverters.this.converters.get(type);
if (converters != null && !converters.isEmpty()) {
for (DataConverter converter : converters) {
@ -277,44 +276,44 @@ public Schema getSchema(int i) {
}
}
public static net.minecraft.nbt.CompoundTag convert(LegacyType type, net.minecraft.nbt.CompoundTag cmp) {
public static CompoundTag convert(LegacyType type, CompoundTag cmp) {
return convert(type.getDFUType(), cmp);
}
public static net.minecraft.nbt.CompoundTag convert(LegacyType type, net.minecraft.nbt.CompoundTag cmp, int sourceVer) {
public static CompoundTag convert(LegacyType type, CompoundTag cmp, int sourceVer) {
return convert(type.getDFUType(), cmp, sourceVer);
}
public static net.minecraft.nbt.CompoundTag convert(LegacyType type, net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public static CompoundTag convert(LegacyType type, CompoundTag cmp, int sourceVer, int targetVer) {
return convert(type.getDFUType(), cmp, sourceVer, targetVer);
}
public static net.minecraft.nbt.CompoundTag convert(TypeReference type, net.minecraft.nbt.CompoundTag cmp) {
public static CompoundTag convert(TypeReference type, CompoundTag cmp) {
int i = cmp.contains("DataVersion", 99) ? cmp.getInt("DataVersion") : -1;
return convert(type, cmp, i);
}
public static net.minecraft.nbt.CompoundTag convert(TypeReference type, net.minecraft.nbt.CompoundTag cmp, int sourceVer) {
public static CompoundTag convert(TypeReference type, CompoundTag cmp, int sourceVer) {
return convert(type, cmp, sourceVer, DATA_VERSION);
}
public static net.minecraft.nbt.CompoundTag convert(TypeReference type, net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public static CompoundTag convert(TypeReference type, CompoundTag cmp, int sourceVer, int targetVer) {
if (sourceVer >= targetVer) {
return cmp;
}
return (net.minecraft.nbt.CompoundTag) INSTANCE.fixer.update(type, new Dynamic<>(OPS_NBT, cmp), sourceVer, targetVer).getValue();
return (CompoundTag) INSTANCE.fixer.update(type, new Dynamic<>(OPS_NBT, cmp), sourceVer, targetVer).getValue();
}
public interface DataInspector {
net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer);
CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer);
}
public interface DataConverter {
int getDataVersion();
net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp);
CompoundTag convert(CompoundTag cmp);
}
@ -592,17 +591,17 @@ private static ResourceLocation getKey(String type) {
return key;
}
private static void convertCompound(LegacyType type, net.minecraft.nbt.CompoundTag cmp, String key, int sourceVer, int targetVer) {
private static void convertCompound(LegacyType type, CompoundTag cmp, String key, int sourceVer, int targetVer) {
cmp.put(key, convert(type, cmp.getCompound(key), sourceVer, targetVer));
}
private static void convertItem(net.minecraft.nbt.CompoundTag nbttagcompound, String key, int sourceVer, int targetVer) {
private static void convertItem(CompoundTag nbttagcompound, String key, int sourceVer, int targetVer) {
if (nbttagcompound.contains(key, 10)) {
convertCompound(LegacyType.ITEM_INSTANCE, nbttagcompound, key, sourceVer, targetVer);
}
}
private static void convertItems(net.minecraft.nbt.CompoundTag nbttagcompound, String key, int sourceVer, int targetVer) {
private static void convertItems(CompoundTag nbttagcompound, String key, int sourceVer, int targetVer) {
if (nbttagcompound.contains(key, 9)) {
ListTag nbttaglist = nbttagcompound.getList(key, 10);
@ -622,14 +621,14 @@ public int getDataVersion() {
return 100;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
ListTag nbttaglist = cmp.getList("Equipment", 10);
ListTag nbttaglist1;
if (!nbttaglist.isEmpty() && !cmp.contains("HandItems", 10)) {
nbttaglist1 = new ListTag();
nbttaglist1.add(nbttaglist.get(0));
nbttaglist1.add(new net.minecraft.nbt.CompoundTag());
nbttaglist1.add(new CompoundTag());
cmp.put("HandItems", nbttaglist1);
}
@ -688,14 +687,14 @@ private static String convertEntityId(int i, String s) {
}
}
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (!cmp.contains("tag", 10)) {
return cmp;
} else {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
if (nbttagcompound1.contains("BlockEntityTag", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("BlockEntityTag");
CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("BlockEntityTag");
String s = cmp.getString("id");
String s1 = convertEntityId(sourceVer, s);
boolean flag;
@ -817,11 +816,11 @@ private static class DataInspectorEntity implements DataInspector {
DataInspectorEntity() {
}
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
if (nbttagcompound1.contains("EntityTag", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("EntityTag");
CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("EntityTag");
String s = cmp.getString("id");
String s1;
@ -859,7 +858,7 @@ private abstract static class DataInspectorTagged implements DataInspector {
this.key = getKey(type);
}
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (this.key.equals(new ResourceLocation(cmp.getString("id")))) {
cmp = this.inspectChecked(cmp, sourceVer, targetVer);
}
@ -867,7 +866,7 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
return cmp;
}
abstract net.minecraft.nbt.CompoundTag inspectChecked(net.minecraft.nbt.CompoundTag nbttagcompound, int sourceVer, int targetVer);
abstract CompoundTag inspectChecked(CompoundTag nbttagcompound, int sourceVer, int targetVer);
}
private static class DataInspectorItemList extends DataInspectorTagged {
@ -879,7 +878,7 @@ private static class DataInspectorItemList extends DataInspectorTagged {
this.keys = astring;
}
net.minecraft.nbt.CompoundTag inspectChecked(net.minecraft.nbt.CompoundTag nbttagcompound, int sourceVer, int targetVer) {
CompoundTag inspectChecked(CompoundTag nbttagcompound, int sourceVer, int targetVer) {
for (String s : this.keys) {
PaperweightDataConverters.convertItems(nbttagcompound, s, sourceVer, targetVer);
}
@ -897,7 +896,7 @@ private static class DataInspectorItem extends DataInspectorTagged {
this.keys = astring;
}
net.minecraft.nbt.CompoundTag inspectChecked(net.minecraft.nbt.CompoundTag nbttagcompound, int sourceVer, int targetVer) {
CompoundTag inspectChecked(CompoundTag nbttagcompound, int sourceVer, int targetVer) {
for (String key : this.keys) {
PaperweightDataConverters.convertItem(nbttagcompound, key, sourceVer, targetVer);
}
@ -917,7 +916,7 @@ public int getDataVersion() {
return 102;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if (cmp.contains("id", 99)) {
short short0 = cmp.getShort("id");
@ -1297,7 +1296,7 @@ public int getDataVersion() {
return 147;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("ArmorStand".equals(cmp.getString("id")) && cmp.getBoolean("Silent") && !cmp.getBoolean("Marker")) {
cmp.remove("Silent");
}
@ -1315,17 +1314,17 @@ public int getDataVersion() {
return 804;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:banner".equals(cmp.getString("id")) && cmp.contains("tag", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
if (nbttagcompound1.contains("BlockEntityTag", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("BlockEntityTag");
CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("BlockEntityTag");
if (nbttagcompound2.contains("Base", 99)) {
cmp.putShort("Damage", (short) (nbttagcompound2.getShort("Base") & 15));
if (nbttagcompound1.contains("display", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound3 = nbttagcompound1.getCompound("display");
CompoundTag nbttagcompound3 = nbttagcompound1.getCompound("display");
if (nbttagcompound3.contains("Lore", 9)) {
ListTag nbttaglist = nbttagcompound3.getList("Lore", 8);
@ -1363,9 +1362,9 @@ public int getDataVersion() {
return 102;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:potion".equals(cmp.getString("id"))) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
short short0 = cmp.getShort("Damage");
if (!nbttagcompound1.contains("Potion", 8)) {
@ -1529,10 +1528,10 @@ public int getDataVersion() {
return 105;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:spawn_egg".equals(cmp.getString("id"))) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("EntityTag");
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("EntityTag");
short short0 = cmp.getShort("Damage");
if (!nbttagcompound2.contains("id", 8)) {
@ -1636,7 +1635,7 @@ public int getDataVersion() {
return 106;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("Minecart".equals(cmp.getString("id"))) {
String s = "MinecartRideable";
int i = cmp.getInt("Type");
@ -1662,13 +1661,13 @@ public int getDataVersion() {
return 107;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if (!"MobSpawner".equals(cmp.getString("id"))) {
return cmp;
} else {
if (cmp.contains("EntityId", 8)) {
String s = cmp.getString("EntityId");
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("SpawnData");
CompoundTag nbttagcompound1 = cmp.getCompound("SpawnData");
nbttagcompound1.putString("id", s.isEmpty() ? "Pig" : s);
cmp.put("SpawnData", nbttagcompound1);
@ -1679,10 +1678,10 @@ public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp)
ListTag nbttaglist = cmp.getList("SpawnPotentials", 10);
for (int i = 0; i < nbttaglist.size(); ++i) {
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttaglist.getCompound(i);
CompoundTag nbttagcompound2 = nbttaglist.getCompound(i);
if (nbttagcompound2.contains("Type", 8)) {
net.minecraft.nbt.CompoundTag nbttagcompound3 = nbttagcompound2.getCompound("Properties");
CompoundTag nbttagcompound3 = nbttagcompound2.getCompound("Properties");
nbttagcompound3.putString("id", nbttagcompound2.getString("Type"));
nbttagcompound2.put("Entity", nbttagcompound3);
@ -1706,7 +1705,7 @@ public int getDataVersion() {
return 108;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if (cmp.contains("UUID", 8)) {
cmp.putUUID("UUID", UUID.fromString(cmp.getString("UUID")));
}
@ -1726,7 +1725,7 @@ public int getDataVersion() {
return 109;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if (DataConverterHealth.a.contains(cmp.getString("id"))) {
float f;
@ -1757,9 +1756,9 @@ public int getDataVersion() {
return 110;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("EntityHorse".equals(cmp.getString("id")) && !cmp.contains("SaddleItem", 10) && cmp.getBoolean("Saddle")) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = new net.minecraft.nbt.CompoundTag();
CompoundTag nbttagcompound1 = new CompoundTag();
nbttagcompound1.putString("id", "minecraft:saddle");
nbttagcompound1.putByte("Count", (byte) 1);
@ -1781,7 +1780,7 @@ public int getDataVersion() {
return 111;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
String s = cmp.getString("id");
boolean flag = "Painting".equals(s);
boolean flag1 = "ItemFrame".equals(s);
@ -1819,7 +1818,7 @@ public int getDataVersion() {
return 113;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
ListTag nbttaglist;
if (cmp.contains("HandDropChances", 9)) {
@ -1849,9 +1848,9 @@ public int getDataVersion() {
return 135;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
while (cmp.contains("Riding", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = this.b(cmp);
CompoundTag nbttagcompound1 = this.b(cmp);
this.convert(cmp, nbttagcompound1);
cmp = nbttagcompound1;
@ -1860,15 +1859,15 @@ public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp)
return cmp;
}
protected void convert(net.minecraft.nbt.CompoundTag nbttagcompound, net.minecraft.nbt.CompoundTag nbttagcompound1) {
protected void convert(CompoundTag nbttagcompound, CompoundTag nbttagcompound1) {
ListTag nbttaglist = new ListTag();
nbttaglist.add(nbttagcompound);
nbttagcompound1.put("Passengers", nbttaglist);
}
protected net.minecraft.nbt.CompoundTag b(net.minecraft.nbt.CompoundTag nbttagcompound) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = nbttagcompound.getCompound("Riding");
protected CompoundTag b(CompoundTag nbttagcompound) {
CompoundTag nbttagcompound1 = nbttagcompound.getCompound("Riding");
nbttagcompound.remove("Riding");
return nbttagcompound1;
@ -1884,9 +1883,9 @@ public int getDataVersion() {
return 165;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:written_book".equals(cmp.getString("id"))) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
if (nbttagcompound1.contains("pages", 9)) {
ListTag nbttaglist = nbttagcompound1.getList("pages", 8);
@ -1954,7 +1953,7 @@ public int getDataVersion() {
return 502;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if (cmp.contains("id", 8) && DataConverterCookedFish.a.equals(new ResourceLocation(cmp.getString("id")))) {
cmp.putString("id", "minecraft:cooked_fish");
}
@ -1974,7 +1973,7 @@ public int getDataVersion() {
return 502;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("Zombie".equals(cmp.getString("id")) && cmp.getBoolean("IsVillager")) {
if (!cmp.contains("ZombieType", 99)) {
int i = -1;
@ -2014,7 +2013,7 @@ public int getDataVersion() {
return 505;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
cmp.putString("useVbo", "true");
return cmp;
}
@ -2029,7 +2028,7 @@ public int getDataVersion() {
return 700;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("Guardian".equals(cmp.getString("id"))) {
if (cmp.getBoolean("Elder")) {
cmp.putString("id", "ElderGuardian");
@ -2051,7 +2050,7 @@ public int getDataVersion() {
return 701;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
String s = cmp.getString("id");
if ("Skeleton".equals(s)) {
@ -2079,7 +2078,7 @@ public int getDataVersion() {
return 702;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("Zombie".equals(cmp.getString("id"))) {
int i = cmp.getInt("ZombieType");
@ -2117,7 +2116,7 @@ public int getDataVersion() {
return 703;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("EntityHorse".equals(cmp.getString("id"))) {
int i = cmp.getInt("Type");
@ -2161,7 +2160,7 @@ public int getDataVersion() {
return 704;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
String s = DataConverterTileEntity.a.get(cmp.getString("id"));
if (s != null) {
@ -2209,7 +2208,7 @@ public int getDataVersion() {
return 704;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
String s = DataConverterEntity.a.get(cmp.getString("id"));
if (s != null) {
@ -2307,11 +2306,11 @@ public int getDataVersion() {
return 806;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
String s = cmp.getString("id");
if ("minecraft:potion".equals(s) || "minecraft:splash_potion".equals(s) || "minecraft:lingering_potion".equals(s) || "minecraft:tipped_arrow".equals(s)) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
if (!nbttagcompound1.contains("Potion", 8)) {
nbttagcompound1.putString("Potion", "minecraft:water");
@ -2335,7 +2334,7 @@ public int getDataVersion() {
return 808;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:shulker".equals(cmp.getString("id")) && !cmp.contains("Color", 99)) {
cmp.putByte("Color", (byte) 10);
}
@ -2355,12 +2354,12 @@ public int getDataVersion() {
return 813;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:shulker_box".equals(cmp.getString("id")) && cmp.contains("tag", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("tag");
CompoundTag nbttagcompound1 = cmp.getCompound("tag");
if (nbttagcompound1.contains("BlockEntityTag", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("BlockEntityTag");
CompoundTag nbttagcompound2 = nbttagcompound1.getCompound("BlockEntityTag");
if (nbttagcompound2.getList("Items", 10).isEmpty()) {
nbttagcompound2.remove("Items");
@ -2394,7 +2393,7 @@ public int getDataVersion() {
return 813;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:shulker".equals(cmp.getString("id"))) {
cmp.remove("Color");
}
@ -2412,7 +2411,7 @@ public int getDataVersion() {
return 816;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if (cmp.contains("lang", 8)) {
cmp.putString("lang", cmp.getString("lang").toLowerCase(Locale.ROOT));
}
@ -2430,7 +2429,7 @@ public int getDataVersion() {
return 820;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:totem".equals(cmp.getString("id"))) {
cmp.putString("id", "minecraft:totem_of_undying");
}
@ -2450,16 +2449,16 @@ public int getDataVersion() {
return 1125;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
try {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("Level");
CompoundTag nbttagcompound1 = cmp.getCompound("Level");
int i = nbttagcompound1.getInt("xPos");
int j = nbttagcompound1.getInt("zPos");
ListTag nbttaglist = nbttagcompound1.getList("TileEntities", 10);
ListTag nbttaglist1 = nbttagcompound1.getList("Sections", 10);
for (int k = 0; k < nbttaglist1.size(); ++k) {
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttaglist1.getCompound(k);
CompoundTag nbttagcompound2 = nbttaglist1.getCompound(k);
byte b0 = nbttagcompound2.getByte("Y");
byte[] abyte = nbttagcompound2.getByteArray("Blocks");
@ -2468,7 +2467,7 @@ public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp)
int i1 = l & 15;
int j1 = l >> 8 & 15;
int k1 = l >> 4 & 15;
net.minecraft.nbt.CompoundTag nbttagcompound3 = new net.minecraft.nbt.CompoundTag();
CompoundTag nbttagcompound3 = new CompoundTag();
nbttagcompound3.putString("id", "bed");
nbttagcompound3.putInt("x", i1 + (i << 4));
@ -2495,7 +2494,7 @@ public int getDataVersion() {
return 1125;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("minecraft:bed".equals(cmp.getString("id")) && cmp.getShort("Damage") == 0) {
cmp.putShort("Damage", (short) DyeColor.RED.getId());
}
@ -2544,7 +2543,7 @@ public int getDataVersion() {
return 101;
}
public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp) {
public CompoundTag convert(CompoundTag cmp) {
if ("Sign".equals(cmp.getString("id"))) {
this.convert(cmp, "Text1");
this.convert(cmp, "Text2");
@ -2555,7 +2554,7 @@ public net.minecraft.nbt.CompoundTag convert(net.minecraft.nbt.CompoundTag cmp)
return cmp;
}
private void convert(net.minecraft.nbt.CompoundTag nbttagcompound, String s) {
private void convert(CompoundTag nbttagcompound, String s) {
String s1 = nbttagcompound.getString(s);
Component object = null;
@ -2602,9 +2601,9 @@ private void convert(net.minecraft.nbt.CompoundTag nbttagcompound, String s) {
private static class DataInspectorPlayerVehicle implements DataInspector {
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (cmp.contains("RootVehicle", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("RootVehicle");
CompoundTag nbttagcompound1 = cmp.getCompound("RootVehicle");
if (nbttagcompound1.contains("Entity", 10)) {
convertCompound(LegacyType.ENTITY, nbttagcompound1, "Entity", sourceVer, targetVer);
@ -2617,7 +2616,7 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
private static class DataInspectorLevelPlayer implements DataInspector {
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (cmp.contains("Player", 10)) {
convertCompound(LegacyType.PLAYER, cmp, "Player", sourceVer, targetVer);
}
@ -2628,16 +2627,16 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
private static class DataInspectorStructure implements DataInspector {
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
ListTag nbttaglist;
int j;
net.minecraft.nbt.CompoundTag nbttagcompound1;
CompoundTag nbttagcompound1;
if (cmp.contains("entities", 9)) {
nbttaglist = cmp.getList("entities", 10);
for (j = 0; j < nbttaglist.size(); ++j) {
nbttagcompound1 = (net.minecraft.nbt.CompoundTag) nbttaglist.get(j);
nbttagcompound1 = (CompoundTag) nbttaglist.get(j);
if (nbttagcompound1.contains("nbt", 10)) {
convertCompound(LegacyType.ENTITY, nbttagcompound1, "nbt", sourceVer, targetVer);
}
@ -2648,7 +2647,7 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
nbttaglist = cmp.getList("blocks", 10);
for (j = 0; j < nbttaglist.size(); ++j) {
nbttagcompound1 = (net.minecraft.nbt.CompoundTag) nbttaglist.get(j);
nbttagcompound1 = (CompoundTag) nbttaglist.get(j);
if (nbttagcompound1.contains("nbt", 10)) {
convertCompound(LegacyType.BLOCK_ENTITY, nbttagcompound1, "nbt", sourceVer, targetVer);
}
@ -2661,9 +2660,9 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
private static class DataInspectorChunks implements DataInspector {
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (cmp.contains("Level", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("Level");
CompoundTag nbttagcompound1 = cmp.getCompound("Level");
ListTag nbttaglist;
int j;
@ -2671,7 +2670,7 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
nbttaglist = nbttagcompound1.getList("Entities", 10);
for (j = 0; j < nbttaglist.size(); ++j) {
nbttaglist.set(j, convert(LegacyType.ENTITY, (net.minecraft.nbt.CompoundTag) nbttaglist.get(j), sourceVer, targetVer));
nbttaglist.set(j, convert(LegacyType.ENTITY, (CompoundTag) nbttaglist.get(j), sourceVer, targetVer));
}
}
@ -2679,7 +2678,7 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
nbttaglist = nbttagcompound1.getList("TileEntities", 10);
for (j = 0; j < nbttaglist.size(); ++j) {
nbttaglist.set(j, convert(LegacyType.BLOCK_ENTITY, (net.minecraft.nbt.CompoundTag) nbttaglist.get(j), sourceVer, targetVer));
nbttaglist.set(j, convert(LegacyType.BLOCK_ENTITY, (CompoundTag) nbttaglist.get(j), sourceVer, targetVer));
}
}
}
@ -2690,7 +2689,7 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
private static class DataInspectorEntityPassengers implements DataInspector {
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (cmp.contains("Passengers", 9)) {
ListTag nbttaglist = cmp.getList("Passengers", 10);
@ -2705,7 +2704,7 @@ public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp,
private static class DataInspectorPlayer implements DataInspector {
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
convertItems(cmp, "Inventory", sourceVer, targetVer);
convertItems(cmp, "EnderItems", sourceVer, targetVer);
if (cmp.contains("ShoulderEntityLeft", 10)) {
@ -2724,15 +2723,15 @@ private static class DataInspectorVillagers implements DataInspector {
ResourceLocation entityVillager = getKey("EntityVillager");
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (entityVillager.equals(new ResourceLocation(cmp.getString("id"))) && cmp.contains("Offers", 10)) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = cmp.getCompound("Offers");
CompoundTag nbttagcompound1 = cmp.getCompound("Offers");
if (nbttagcompound1.contains("Recipes", 9)) {
ListTag nbttaglist = nbttagcompound1.getList("Recipes", 10);
for (int j = 0; j < nbttaglist.size(); ++j) {
net.minecraft.nbt.CompoundTag nbttagcompound2 = nbttaglist.getCompound(j);
CompoundTag nbttagcompound2 = nbttaglist.getCompound(j);
convertItem(nbttagcompound2, "buy", sourceVer, targetVer);
convertItem(nbttagcompound2, "buyB", sourceVer, targetVer);
@ -2751,7 +2750,7 @@ private static class DataInspectorMobSpawnerMinecart implements DataInspector {
ResourceLocation tileEntityMobSpawner = getKey("TileEntityMobSpawner");
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
String s = cmp.getString("id");
if (entityMinecartMobSpawner.equals(new ResourceLocation(s))) {
cmp.putString("id", tileEntityMobSpawner.toString());
@ -2767,13 +2766,13 @@ private static class DataInspectorMobSpawnerMobs implements DataInspector {
ResourceLocation tileEntityMobSpawner = getKey("TileEntityMobSpawner");
@Override
public net.minecraft.nbt.CompoundTag inspect(net.minecraft.nbt.CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (tileEntityMobSpawner.equals(new ResourceLocation(cmp.getString("id")))) {
if (cmp.contains("SpawnPotentials", 9)) {
ListTag nbttaglist = cmp.getList("SpawnPotentials", 10);
for (int j = 0; j < nbttaglist.size(); ++j) {
net.minecraft.nbt.CompoundTag nbttagcompound1 = nbttaglist.getCompound(j);
CompoundTag nbttagcompound1 = nbttaglist.getCompound(j);
convertCompound(LegacyType.ENTITY, nbttagcompound1, "Entity", sourceVer, targetVer);
}
@ -2790,7 +2789,7 @@ private static class DataInspectorCommandBlock implements DataInspector {
ResourceLocation tileEntityCommand = getKey("TileEntityCommand");
@Override
public net.minecraft.nbt.CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
public CompoundTag inspect(CompoundTag cmp, int sourceVer, int targetVer) {
if (tileEntityCommand.equals(new ResourceLocation(cmp.getString("id")))) {
cmp.putString("id", "Control");
convert(LegacyType.BLOCK_ENTITY, cmp, sourceVer, targetVer);