diff --git a/patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 86535889ed..4b51e7bca8 100644 --- a/patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/patches/server/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -100,15 +100,6 @@ diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java +++ b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java -@@ -0,0 +0,0 @@ public class EntityLookup { - for(T entityAccess : this.byId.values()) { - U entityAccess2 = (U)((EntityAccess)filter.tryCast(entityAccess)); - if (entityAccess2 != null) { -- action.accept((T)entityAccess2); -+ action.accept(entityAccess2); // Paper - decompile fix - } - } - @@ -0,0 +0,0 @@ public class EntityLookup { UUID uUID = entity.getUUID(); if (this.byUuid.containsKey(uUID)) { diff --git a/patches/server/Anti-Xray.patch b/patches/server/Anti-Xray.patch index 7e75e01e50..c83ff6f322 100644 --- a/patches/server/Anti-Xray.patch +++ b/patches/server/Anti-Xray.patch @@ -1323,7 +1323,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return 0; }; public final IdMap registry; -+ private final T[] presetValues; // Paper - Anti-Xray - Add preset values ++ private final T @org.jetbrains.annotations.Nullable [] presetValues; // Paper - Anti-Xray - Add preset values private volatile PalettedContainer.Data data; private final PalettedContainer.Strategy strategy; private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer"); @@ -1335,7 +1335,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Anti-Xray - Add preset values + @Deprecated public static Codec> codec(IdMap idList, Codec entryCodec, PalettedContainer.Strategy provider, T object) { return PalettedContainer.codec(idList, entryCodec, provider, object, null); } // Notice for updates: Please make sure this function isn't used anywhere + public static Codec> codec(IdMap idList, Codec entryCodec, PalettedContainer.Strategy provider, T object, T @org.jetbrains.annotations.Nullable [] presetValues) { - return RecordCodecBuilder.create((instance) -> { + return RecordCodecBuilder.>create((instance) -> { // Paper - decompile fix return instance.group(entryCodec.mapResult(ExtraCodecs.orElsePartial(object)).listOf().fieldOf("palette").forGetter(PalettedContainer.DiscData::paletteEntries), Codec.LONG_STREAM.optionalFieldOf("data").forGetter(PalettedContainer.DiscData::storage)).apply(instance, PalettedContainer.DiscData::new); }).comapFlatMap((serialized) -> { - return read(idList, provider, serialized); @@ -1349,7 +1349,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - public PalettedContainer(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Configuration dataProvider, BitStorage storage, List paletteEntries) { + // Paper start - Anti-Xray - Add preset values + @Deprecated public PalettedContainer(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Configuration dataProvider, BitStorage storage, List paletteEntries) { this(idList, paletteProvider, dataProvider, storage, paletteEntries, null, null); } // Notice for updates: Please make sure this constructor isn't used anywhere -+ public PalettedContainer(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Configuration dataProvider, BitStorage storage, List paletteEntries, T defaultValue, T[] presetValues) { ++ public PalettedContainer(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Configuration dataProvider, BitStorage storage, List paletteEntries, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { + this.presetValues = presetValues; this.registry = idList; this.strategy = paletteProvider; @@ -1381,7 +1381,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - private PalettedContainer(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Data data) { + // Paper start - Anti-Xray - Add preset values -+ private PalettedContainer(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Data data, T[] presetValues) { ++ private PalettedContainer(IdMap idList, PalettedContainer.Strategy paletteProvider, PalettedContainer.Data data, T @org.jetbrains.annotations.Nullable [] presetValues) { + this.presetValues = presetValues; + // Paper end this.registry = idList; @@ -1447,7 +1447,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - public void write(FriendlyByteBuf buf) { + // Paper start - Anti-Xray - Add chunk packet info + @Deprecated public void write(FriendlyByteBuf buf) { this.write(buf, null, 0); } // Notice for updates: Please make sure this method isn't used anywhere -+ public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { ++ public void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { this.acquire(); try { @@ -1467,7 +1467,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - private static DataResult> read(IdMap idList, PalettedContainer.Strategy provider, PalettedContainer.DiscData serialized) { -+ private static DataResult> read(IdMap idList, PalettedContainer.Strategy provider, PalettedContainer.DiscData serialized, T defaultValue, T[] presetValues) { // Paper - Anti-Xray - Add preset values ++ private static DataResult> read(IdMap idList, PalettedContainer.Strategy provider, PalettedContainer.DiscData serialized, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { // Paper - Anti-Xray - Add preset values List list = serialized.paletteEntries(); int i = provider.size(); int j = provider.calculateBitsForSerialization(idList, list.size()); @@ -1495,7 +1495,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - public void write(FriendlyByteBuf buf) { + // Paper start - Anti-Xray - Add chunk packet info -+ public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { ++ public void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { buf.writeByte(this.storage.getBits()); this.palette.write(buf); + diff --git a/patches/server/Avoid-hopper-searches-if-there-are-no-items.patch b/patches/server/Avoid-hopper-searches-if-there-are-no-items.patch index f0ca482434..3e24d9413a 100644 --- a/patches/server/Avoid-hopper-searches-if-there-are-no-items.patch +++ b/patches/server/Avoid-hopper-searches-if-there-are-no-items.patch @@ -66,15 +66,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return this.storage.remove(entity); } -@@ -0,0 +0,0 @@ public class EntitySection { - for(T entityAccess : collection) { - U entityAccess2 = (U)((EntityAccess)type.tryCast(entityAccess)); - if (entityAccess2 != null && entityAccess.getBoundingBox().intersects(box)) { -- action.accept((T)entityAccess2); -+ action.accept(entityAccess2); // Paper - decompile fixes - } - } - diff --git a/src/main/java/net/minecraft/world/level/entity/EntitySectionStorage.java b/src/main/java/net/minecraft/world/level/entity/EntitySectionStorage.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/entity/EntitySectionStorage.java diff --git a/patches/server/Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch b/patches/server/CB-fixes.patch similarity index 96% rename from patches/server/Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch rename to patches/server/CB-fixes.patch index 12f895be5f..7cd96d39b2 100644 --- a/patches/server/Fix-missing-Level-LevelStem-in-StructureCheck-from-C.patch +++ b/patches/server/CB-fixes.patch @@ -1,9 +1,10 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Fri, 25 Feb 2022 07:14:48 -0800 -Subject: [PATCH] Fix missing Level -> LevelStem in StructureCheck from CB +Subject: [PATCH] CB fixes -Need to use the right for injectDatafixingContext +* Missing Level -> LevelStem generic in StructureCheck + Need to use the right for injectDatafixingContext diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/patches/server/Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch b/patches/server/Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch index 01a1d98915..1533e988c9 100644 --- a/patches/server/Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch +++ b/patches/server/Dont-count-named-piglins-and-hoglins-towards-mob-cap.patch @@ -10,15 +10,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java @@ -0,0 +0,0 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { - @Override - public Brain getBrain() { -- return super.getBrain(); -+ return (Brain) super.getBrain(); // Paper - decompile fix - } - - @Override -@@ -0,0 +0,0 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { - @Override public boolean removeWhenFarAway(double distanceSquared) { - return !this.isPersistenceRequired(); diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index b7f1264691..7853585ce1 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -64,6 +64,36 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private final List list; private byte type; +diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/nbt/NbtUtils.java ++++ b/src/main/java/net/minecraft/nbt/NbtUtils.java +@@ -0,0 +0,0 @@ import net.minecraft.world.level.material.FluidState; + import org.slf4j.Logger; + + public final class NbtUtils { +- private static final Comparator YXZ_LISTTAG_INT_COMPARATOR = Comparator.comparingInt((nbt) -> { ++ private static final Comparator YXZ_LISTTAG_INT_COMPARATOR = Comparator.comparingInt((nbt) -> { // Paper - decompile fix + return nbt.getInt(1); + }).thenComparingInt((nbt) -> { + return nbt.getInt(0); + }).thenComparingInt((nbt) -> { + return nbt.getInt(2); + }); +- private static final Comparator YXZ_LISTTAG_DOUBLE_COMPARATOR = Comparator.comparingDouble((nbt) -> { ++ private static final Comparator YXZ_LISTTAG_DOUBLE_COMPARATOR = Comparator.comparingDouble((nbt) -> { // Paper - decompile fix + return nbt.getDouble(1); + }).thenComparingDouble((nbt) -> { + return nbt.getDouble(0); +@@ -0,0 +0,0 @@ public final class NbtUtils { + } + + public static CompoundTag update(DataFixer fixer, DataFixTypes fixTypes, CompoundTag compound, int oldVersion, int targetVersion) { +- return fixer.update(fixTypes.getType(), new Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); ++ return (CompoundTag) fixer.update(fixTypes.getType(), new Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); // Paper - decompile fix + } + + public static Component toPrettyComponent(Tag element) { diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/ConnectionProtocol.java @@ -204,6 +234,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return instance.group(RecordCodecBuilder.point(updateListener), Codec.BOOL.optionalFieldOf("Valid", Boolean.valueOf(false)).forGetter((poiSet) -> { return poiSet.isValid; }), PoiRecord.codec(updateListener).listOf().fieldOf("Records").forGetter((poiSet) -> { +diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +@@ -0,0 +0,0 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { + + @Override + public Brain getBrain() { +- return super.getBrain(); ++ return (Brain) super.getBrain(); // Paper - decompile fix + } + + @Override diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java @@ -224,6 +267,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class PalettedContainer implements PaletteResize { } + public static Codec> codec(IdMap idList, Codec entryCodec, PalettedContainer.Strategy provider, T object) { +- return RecordCodecBuilder.create((instance) -> { ++ return RecordCodecBuilder.>create((instance) -> { // Paper - decompile fix + return instance.group(entryCodec.mapResult(ExtraCodecs.orElsePartial(object)).listOf().fieldOf("palette").forGetter(PalettedContainer.DiscData::paletteEntries), Codec.LONG_STREAM.optionalFieldOf("data").forGetter(PalettedContainer.DiscData::storage)).apply(instance, PalettedContainer.DiscData::new); + }).comapFlatMap((serialized) -> { + return read(idList, provider, serialized); +@@ -0,0 +0,0 @@ public class PalettedContainer implements PaletteResize { + } + static record Configuration(Palette.Factory factory, int bits) { - Configuration(Palette.Factory factory, int i) { - this.factory = factory; @@ -243,3 +295,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } public abstract static class Strategy { +diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java ++++ b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java +@@ -0,0 +0,0 @@ public class EntityLookup { + for(T entityAccess : this.byId.values()) { + U entityAccess2 = (U)((EntityAccess)filter.tryCast(entityAccess)); + if (entityAccess2 != null) { +- action.accept((T)entityAccess2); ++ action.accept(entityAccess2); // Paper - decompile fix + } + } + +diff --git a/src/main/java/net/minecraft/world/level/entity/EntitySection.java b/src/main/java/net/minecraft/world/level/entity/EntitySection.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/entity/EntitySection.java ++++ b/src/main/java/net/minecraft/world/level/entity/EntitySection.java +@@ -0,0 +0,0 @@ public class EntitySection { + for(T entityAccess : collection) { + U entityAccess2 = (U)((EntityAccess)type.tryCast(entityAccess)); + if (entityAccess2 != null && entityAccess.getBoundingBox().intersects(box)) { +- action.accept((T)entityAccess2); ++ action.accept(entityAccess2); // Paper - decompile fix + } + } + diff --git a/patches/server/Support-old-UUID-format-for-NBT.patch b/patches/server/Support-old-UUID-format-for-NBT.patch index 507b8c5153..d32ba32be1 100644 --- a/patches/server/Support-old-UUID-format-for-NBT.patch +++ b/patches/server/Support-old-UUID-format-for-NBT.patch @@ -49,23 +49,6 @@ diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/m index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java +++ b/src/main/java/net/minecraft/nbt/NbtUtils.java -@@ -0,0 +0,0 @@ import net.minecraft.world.level.material.FluidState; - import org.slf4j.Logger; - - public final class NbtUtils { -- private static final Comparator YXZ_LISTTAG_INT_COMPARATOR = Comparator.comparingInt((nbt) -> { -+ private static final Comparator YXZ_LISTTAG_INT_COMPARATOR = Comparator.comparingInt((nbt) -> { // Paper - decompile fix - return nbt.getInt(1); - }).thenComparingInt((nbt) -> { - return nbt.getInt(0); - }).thenComparingInt((nbt) -> { - return nbt.getInt(2); - }); -- private static final Comparator YXZ_LISTTAG_DOUBLE_COMPARATOR = Comparator.comparingDouble((nbt) -> { -+ private static final Comparator YXZ_LISTTAG_DOUBLE_COMPARATOR = Comparator.comparingDouble((nbt) -> { // Paper - decompile fix - return nbt.getDouble(1); - }).thenComparingDouble((nbt) -> { - return nbt.getDouble(0); @@ -0,0 +0,0 @@ public final class NbtUtils { if (compound.contains("Name", 8)) { string = compound.getString("Name"); @@ -78,12 +61,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (compound.hasUUID("Id")) { uUID = compound.getUUID("Id"); -@@ -0,0 +0,0 @@ public final class NbtUtils { - } - - public static CompoundTag update(DataFixer fixer, DataFixTypes fixTypes, CompoundTag compound, int oldVersion, int targetVersion) { -- return fixer.update(fixTypes.getType(), new Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); -+ return (CompoundTag) fixer.update(fixTypes.getType(), new Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); // Paper - decompile fix - } - - public static Component toPrettyComponent(Tag element) { diff --git a/patches/server/Synchronize-PalettedContainer-instead-of-ReentrantLo.patch b/patches/server/Synchronize-PalettedContainer-instead-of-ReentrantLo.patch index 533eece542..c716f610fb 100644 --- a/patches/server/Synchronize-PalettedContainer-instead-of-ReentrantLo.patch +++ b/patches/server/Synchronize-PalettedContainer-instead-of-ReentrantLo.patch @@ -30,13 +30,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } // Paper start - Anti-Xray - Add preset values - @Deprecated public static Codec> codec(IdMap idList, Codec entryCodec, PalettedContainer.Strategy provider, T object) { return PalettedContainer.codec(idList, entryCodec, provider, object, null); } // Notice for updates: Please make sure this function isn't used anywhere - public static Codec> codec(IdMap idList, Codec entryCodec, PalettedContainer.Strategy provider, T object, T @org.jetbrains.annotations.Nullable [] presetValues) { -- return RecordCodecBuilder.create((instance) -> { -+ return RecordCodecBuilder.>create((instance) -> { // Paper - decompile fixes - return instance.group(entryCodec.mapResult(ExtraCodecs.orElsePartial(object)).listOf().fieldOf("palette").forGetter(PalettedContainer.DiscData::paletteEntries), Codec.LONG_STREAM.optionalFieldOf("data").forGetter(PalettedContainer.DiscData::storage)).apply(instance, PalettedContainer.DiscData::new); - }).comapFlatMap((serialized) -> { - return read(idList, provider, serialized, object, presetValues); @@ -0,0 +0,0 @@ public class PalettedContainer implements PaletteResize { } // Paper end @@ -68,8 +61,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Paper start - Anti-Xray - Add chunk packet info @Deprecated public void write(FriendlyByteBuf buf) { this.write(buf, null, 0); } // Notice for updates: Please make sure this method isn't used anywhere -- public void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { -+ public synchronized void write(FriendlyByteBuf buf, com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { // Paper - synchronize +- public void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { ++ public synchronized void write(FriendlyByteBuf buf, @Nullable com.destroystokyo.paper.antixray.ChunkPacketInfo chunkPacketInfo, int bottomBlockY) { // Paper - synchronize this.acquire(); try { @@ -77,8 +70,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } -- private static DataResult> read(IdMap idList, PalettedContainer.Strategy provider, PalettedContainer.DiscData serialized, T defaultValue, T[] presetValues) { // Paper - Anti-Xray - Add preset values -+ private synchronized static DataResult> read(IdMap idList, PalettedContainer.Strategy provider, PalettedContainer.DiscData serialized, T defaultValue, T[] presetValues) { // Paper - Anti-Xray - Add preset values // Paper - synchronize +- private static DataResult> read(IdMap idList, PalettedContainer.Strategy provider, PalettedContainer.DiscData serialized, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { // Paper - Anti-Xray - Add preset values ++ private synchronized static DataResult> read(IdMap idList, PalettedContainer.Strategy provider, PalettedContainer.DiscData serialized, T defaultValue, T @org.jetbrains.annotations.Nullable [] presetValues) { // Paper - Anti-Xray - Add preset values // Paper - synchronize List list = serialized.paletteEntries(); int i = provider.size(); int j = provider.calculateBitsForSerialization(idList, list.size());