From 45c36e5d0c1a09a2fa144abee5705524fb758e7a Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 24 Nov 2021 16:07:19 +0100 Subject: [PATCH] More more more more more more more more more more more more more work --- build-data/dev-imports.txt | 1 + ...mplement-PlayerRecipeBookClickEvent.patch} | 0 ...0211-Support-components-in-ItemMeta.patch} | 0 ...TargetReasons-for-1.16-mob-behavior.patch} | 0 .../0213-Add-entity-liquid-API.patch} | 2 +- ...eResultEvent-PrepareGrindstoneEvent.patch} | 0 ...low-delegation-to-vanilla-chunk-gen.patch} | 8 +- ...low-delegation-to-vanilla-chunk-gen.patch} | 14 +- ...d-Difficulty-Remembering-Difficulty.patch} | 0 ...atch => 0446-Paper-dumpitem-command.patch} | 0 ...47-Don-t-allow-null-UUID-s-for-chat.patch} | 0 ...Legacy-Component-serialization-size.patch} | 0 ...Optimize-Bit-Operations-by-inlining.patch} | 28 +-- ...Plugin-Tickets-to-API-Chunk-Methods.patch} | 8 +- ...e-operations-for-updating-light-dat.patch} | 22 +- ...452-Support-old-UUID-format-for-NBT.patch} | 51 ++--- ...p-duplicated-GameProfile-Properties.patch} | 2 +- ...vert-legacy-attributes-in-Item-Meta.patch} | 2 +- ...-Remove-some-streams-from-structures.patch | 37 ++++ ...rom-classes-related-villager-gossip.patch} | 2 +- ...e-NibbleArray-to-use-pooled-buffers.patch} | 191 ++++++++++++------ ...0458-Support-components-in-ItemMeta.patch} | 2 +- ...rgetLivingEntityEvent-for-1.16-mobs.patch} | 4 +- .../0460-Add-entity-liquid-API.patch} | 6 +- ...date-itemstack-legacy-name-and-lore.patch} | 4 +- ...wn-player-in-correct-world-on-login.patch} | 2 +- .../0463-Add-PrepareResultEvent.patch} | 20 +- ...-for-portal-on-world-gen-entity-add.patch} | 4 +- ...-Remove-some-streams-from-structures.patch | 106 ---------- 29 files changed, 247 insertions(+), 269 deletions(-) rename patches/api/{0211-Add-and-implement-PlayerRecipeBookClickEvent.patch => 0210-Add-and-implement-PlayerRecipeBookClickEvent.patch} (100%) rename patches/{unapplied/api/0212-Support-components-in-ItemMeta.patch => api/0211-Support-components-in-ItemMeta.patch} (100%) rename patches/{unapplied/api/0213-added-2-new-TargetReasons-for-1.16-mob-behavior.patch => api/0212-added-2-new-TargetReasons-for-1.16-mob-behavior.patch} (100%) rename patches/{unapplied/api/0214-Add-entity-liquid-API.patch => api/0213-Add-entity-liquid-API.patch} (92%) rename patches/{unapplied/api/0215-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch => api/0214-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch} (100%) rename patches/{unapplied/api/0216-Allow-delegation-to-vanilla-chunk-gen.patch => removed/1.18/0215-Allow-delegation-to-vanilla-chunk-gen.patch} (90%) rename patches/{unapplied/server/0485-Allow-delegation-to-vanilla-chunk-gen.patch => removed/1.18/0464-Allow-delegation-to-vanilla-chunk-gen.patch} (84%) rename patches/server/{0446-Fix-Per-World-Difficulty-Remembering-Difficulty.patch => 0445-Fix-Per-World-Difficulty-Remembering-Difficulty.patch} (100%) rename patches/server/{0447-Paper-dumpitem-command.patch => 0446-Paper-dumpitem-command.patch} (100%) rename patches/server/{0448-Don-t-allow-null-UUID-s-for-chat.patch => 0447-Don-t-allow-null-UUID-s-for-chat.patch} (100%) rename patches/server/{0449-Improve-Legacy-Component-serialization-size.patch => 0448-Improve-Legacy-Component-serialization-size.patch} (100%) rename patches/{unapplied/server/0453-Optimize-Bit-Operations-by-inlining.patch => server/0449-Optimize-Bit-Operations-by-inlining.patch} (91%) rename patches/{unapplied/server/0454-Add-Plugin-Tickets-to-API-Chunk-Methods.patch => server/0450-Add-Plugin-Tickets-to-API-Chunk-Methods.patch} (95%) rename patches/{unapplied/server/0472-Stop-copy-on-write-operations-for-updating-light-dat.patch => server/0451-Stop-copy-on-write-operations-for-updating-light-dat.patch} (96%) rename patches/{unapplied/server/0473-Support-old-UUID-format-for-NBT.patch => server/0452-Support-old-UUID-format-for-NBT.patch} (63%) rename patches/{unapplied/server/0474-Clean-up-duplicated-GameProfile-Properties.patch => server/0453-Clean-up-duplicated-GameProfile-Properties.patch} (96%) rename patches/{unapplied/server/0475-Convert-legacy-attributes-in-Item-Meta.patch => server/0454-Convert-legacy-attributes-in-Item-Meta.patch} (97%) create mode 100644 patches/server/0455-Remove-some-streams-from-structures.patch rename patches/{unapplied/server/0477-Remove-streams-from-classes-related-villager-gossip.patch => server/0456-Remove-streams-from-classes-related-villager-gossip.patch} (97%) rename patches/{unapplied/server/0478-Optimize-NibbleArray-to-use-pooled-buffers.patch => server/0457-Optimize-NibbleArray-to-use-pooled-buffers.patch} (66%) rename patches/{unapplied/server/0479-Support-components-in-ItemMeta.patch => server/0458-Support-components-in-ItemMeta.patch} (97%) rename patches/{unapplied/server/0480-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch => server/0459-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch} (96%) rename patches/{unapplied/server/0481-Add-entity-liquid-API.patch => server/0460-Add-entity-liquid-API.patch} (86%) rename patches/{unapplied/server/0482-Update-itemstack-legacy-name-and-lore.patch => server/0461-Update-itemstack-legacy-name-and-lore.patch} (94%) rename patches/{unapplied/server/0483-Spawn-player-in-correct-world-on-login.patch => server/0462-Spawn-player-in-correct-world-on-login.patch} (94%) rename patches/{unapplied/server/0484-Add-PrepareResultEvent.patch => server/0463-Add-PrepareResultEvent.patch} (90%) rename patches/{unapplied/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch => server/0465-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch} (84%) delete mode 100644 patches/unapplied/server/0476-Remove-some-streams-from-structures.patch diff --git a/build-data/dev-imports.txt b/build-data/dev-imports.txt index b818b96e27..286aeeaaa9 100644 --- a/build-data/dev-imports.txt +++ b/build-data/dev-imports.txt @@ -8,3 +8,4 @@ # To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId: # minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter # minecraft net/minecraft/world/level/entity/LevelEntityGetter.java + diff --git a/patches/api/0211-Add-and-implement-PlayerRecipeBookClickEvent.patch b/patches/api/0210-Add-and-implement-PlayerRecipeBookClickEvent.patch similarity index 100% rename from patches/api/0211-Add-and-implement-PlayerRecipeBookClickEvent.patch rename to patches/api/0210-Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/patches/unapplied/api/0212-Support-components-in-ItemMeta.patch b/patches/api/0211-Support-components-in-ItemMeta.patch similarity index 100% rename from patches/unapplied/api/0212-Support-components-in-ItemMeta.patch rename to patches/api/0211-Support-components-in-ItemMeta.patch diff --git a/patches/unapplied/api/0213-added-2-new-TargetReasons-for-1.16-mob-behavior.patch b/patches/api/0212-added-2-new-TargetReasons-for-1.16-mob-behavior.patch similarity index 100% rename from patches/unapplied/api/0213-added-2-new-TargetReasons-for-1.16-mob-behavior.patch rename to patches/api/0212-added-2-new-TargetReasons-for-1.16-mob-behavior.patch diff --git a/patches/unapplied/api/0214-Add-entity-liquid-API.patch b/patches/api/0213-Add-entity-liquid-API.patch similarity index 92% rename from patches/unapplied/api/0214-Add-entity-liquid-API.patch rename to patches/api/0213-Add-entity-liquid-API.patch index 7411e3493d..889c3a77f4 100644 --- a/patches/unapplied/api/0214-Add-entity-liquid-API.patch +++ b/patches/api/0213-Add-entity-liquid-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add entity liquid API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 3bb7154a5be37e1943e4f94b5496019c07ca6937..c729cb44290cd719e7684fd919bf74300484b883 100644 +index 4ed3486e8ef097837cf6762b618e08fa9ff166a5..b7d3cd271cccbc250914c5bc17ae892ffcf14b57 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -725,5 +725,35 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/patches/unapplied/api/0215-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch b/patches/api/0214-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch similarity index 100% rename from patches/unapplied/api/0215-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch rename to patches/api/0214-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch diff --git a/patches/unapplied/api/0216-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/removed/1.18/0215-Allow-delegation-to-vanilla-chunk-gen.patch similarity index 90% rename from patches/unapplied/api/0216-Allow-delegation-to-vanilla-chunk-gen.patch rename to patches/removed/1.18/0215-Allow-delegation-to-vanilla-chunk-gen.patch index a72342a3b8..6c3a867b94 100644 --- a/patches/unapplied/api/0216-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/removed/1.18/0215-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 474b7a7d14d1b4ef8146c7b23883651ff776e41b..2bcae78ec0016b465b611041b8397fee5a04baaf 100644 +index 338f0938fbae7eec6cecaf3f1cd30d3e27ad40d6..dc0ceb725aebcce9d048b53e06d4fa84bb3afbe1 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1620,6 +1620,22 @@ public final class Bukkit { +@@ -1634,6 +1634,22 @@ public final class Bukkit { return server.createChunkData(world); } @@ -32,10 +32,10 @@ index 474b7a7d14d1b4ef8146c7b23883651ff776e41b..2bcae78ec0016b465b611041b8397fee * Creates a boss bar instance to display to players. The progress * defaults to 1.0 diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 4800e1e0f127cc159bcc75c856aee9102462b01a..2a2f009a957c19a6d1ef1e284b27fe2f954f13e0 100644 +index 5a98eaeafafc11a7f925701187fc96eb5c675efe..b47eb644b35d27eb5ff65a2ff62e451d23e8026b 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1371,6 +1371,20 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi +@@ -1383,6 +1383,20 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @NotNull public ChunkGenerator.ChunkData createChunkData(@NotNull World world); diff --git a/patches/unapplied/server/0485-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/removed/1.18/0464-Allow-delegation-to-vanilla-chunk-gen.patch similarity index 84% rename from patches/unapplied/server/0485-Allow-delegation-to-vanilla-chunk-gen.patch rename to patches/removed/1.18/0464-Allow-delegation-to-vanilla-chunk-gen.patch index e21ced551f..f633521c31 100644 --- a/patches/unapplied/server/0485-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/removed/1.18/0464-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index da9fc8a99576f13a52ab4830cb09b69b1e406fae..81effb4bc34d3cb4325510c1b0de39956961c427 100644 +index b1dfd1b13652807882e057ae4fb55f9a045d1a16..926ecc79744142c1361399afa61719db435638fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2198,6 +2198,32 @@ public final class CraftServer implements Server { - return new OldCraftChunkData(world); +@@ -2244,6 +2244,32 @@ public final class CraftServer implements Server { + return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY)); } + // Paper start @@ -42,19 +42,19 @@ index da9fc8a99576f13a52ab4830cb09b69b1e406fae..81effb4bc34d3cb4325510c1b0de3995 public BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag... flags) { return new CraftBossBar(title, color, style, flags); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -index a48c659c02c6c33a8efdac6daf9c9a0708f05071..932bd3334b5852c8f209678b1444fc0e43a637f0 100644 +index 960405935e395a31c0300773c41413801cf0d290..f86a8619862c752ca5d47a2ce4c2d0fab6f0810d 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -@@ -22,7 +22,7 @@ import org.bukkit.material.MaterialData; +@@ -23,7 +23,7 @@ import org.bukkit.material.MaterialData; public final class OldCraftChunkData implements ChunkGenerator.ChunkData { private final int minHeight; private final int maxHeight; - private final LevelChunkSection[] sections; + private LevelChunkSection[] sections; + private final Registry biomes; private Set tiles; private final Set lights = new HashSet<>(); - private World world; // Paper - Anti-Xray - Add parameters -@@ -195,4 +195,10 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { +@@ -192,4 +192,10 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { Set getLights() { return this.lights; } diff --git a/patches/server/0446-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0445-Fix-Per-World-Difficulty-Remembering-Difficulty.patch similarity index 100% rename from patches/server/0446-Fix-Per-World-Difficulty-Remembering-Difficulty.patch rename to patches/server/0445-Fix-Per-World-Difficulty-Remembering-Difficulty.patch diff --git a/patches/server/0447-Paper-dumpitem-command.patch b/patches/server/0446-Paper-dumpitem-command.patch similarity index 100% rename from patches/server/0447-Paper-dumpitem-command.patch rename to patches/server/0446-Paper-dumpitem-command.patch diff --git a/patches/server/0448-Don-t-allow-null-UUID-s-for-chat.patch b/patches/server/0447-Don-t-allow-null-UUID-s-for-chat.patch similarity index 100% rename from patches/server/0448-Don-t-allow-null-UUID-s-for-chat.patch rename to patches/server/0447-Don-t-allow-null-UUID-s-for-chat.patch diff --git a/patches/server/0449-Improve-Legacy-Component-serialization-size.patch b/patches/server/0448-Improve-Legacy-Component-serialization-size.patch similarity index 100% rename from patches/server/0449-Improve-Legacy-Component-serialization-size.patch rename to patches/server/0448-Improve-Legacy-Component-serialization-size.patch diff --git a/patches/unapplied/server/0453-Optimize-Bit-Operations-by-inlining.patch b/patches/server/0449-Optimize-Bit-Operations-by-inlining.patch similarity index 91% rename from patches/unapplied/server/0453-Optimize-Bit-Operations-by-inlining.patch rename to patches/server/0449-Optimize-Bit-Operations-by-inlining.patch index db577042d8..e0dc27b511 100644 --- a/patches/unapplied/server/0453-Optimize-Bit-Operations-by-inlining.patch +++ b/patches/server/0449-Optimize-Bit-Operations-by-inlining.patch @@ -7,7 +7,7 @@ Inline bit operations and reduce instruction count to make these hot operations faster diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java -index 80d8873bc2512ecde6a531e974b14e9b48402d64..b70aa66732fb5e957aed0901f4c76358b2c56f8e 100644 +index d38049bed6f3dc3198e687686ef4d8938c7a6b59..0dcf75c5c792650d7a5b9354222df16bcd1cfbd2 100644 --- a/src/main/java/net/minecraft/core/BlockPos.java +++ b/src/main/java/net/minecraft/core/BlockPos.java @@ -30,15 +30,16 @@ public class BlockPos extends Vec3i { @@ -76,18 +76,18 @@ index 80d8873bc2512ecde6a531e974b14e9b48402d64..b70aa66732fb5e957aed0901f4c76358 public static long asLong(int x, int y, int z) { - long l = 0L; -- l = l | ((long)x & PACKED_X_MASK) << X_OFFSET; -- l = l | ((long)y & PACKED_Y_MASK) << 0; +- l |= ((long)x & PACKED_X_MASK) << X_OFFSET; +- l |= ((long)y & PACKED_Y_MASK) << 0; - return l | ((long)z & PACKED_Z_MASK) << Z_OFFSET; + return (((long) x & (long) 67108863) << 38) | (((long) y & (long) 4095)) | (((long) z & (long) 67108863) << 12); // Paper - inline constants and simplify } public static long getFlatIndex(long y) { diff --git a/src/main/java/net/minecraft/core/SectionPos.java b/src/main/java/net/minecraft/core/SectionPos.java -index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafdebc5520f9 100644 +index f9a6e9a7403d3fe8726214da981fdc599956f856..51567ca63a0d2748515d002e1f838bbb14afc162 100644 --- a/src/main/java/net/minecraft/core/SectionPos.java +++ b/src/main/java/net/minecraft/core/SectionPos.java -@@ -37,7 +37,7 @@ public class SectionPos extends Vec3i { +@@ -38,7 +38,7 @@ public class SectionPos extends Vec3i { } public static SectionPos of(BlockPos pos) { @@ -96,7 +96,7 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde } public static SectionPos of(ChunkPos chunkPos, int y) { -@@ -49,7 +49,7 @@ public class SectionPos extends Vec3i { +@@ -50,7 +50,7 @@ public class SectionPos extends Vec3i { } public static SectionPos of(long packed) { @@ -105,7 +105,7 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde } public static SectionPos bottomOf(ChunkAccess chunk) { -@@ -60,8 +60,16 @@ public class SectionPos extends Vec3i { +@@ -61,8 +61,16 @@ public class SectionPos extends Vec3i { return offset(packed, direction.getStepX(), direction.getStepY(), direction.getStepZ()); } @@ -123,7 +123,7 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde } public static int posToSectionCoord(double coord) { -@@ -77,10 +85,7 @@ public class SectionPos extends Vec3i { +@@ -78,10 +86,7 @@ public class SectionPos extends Vec3i { } public static short sectionRelativePos(BlockPos pos) { @@ -135,7 +135,7 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde } public static int sectionRelativeX(short packedLocalPos) { -@@ -143,16 +148,16 @@ public class SectionPos extends Vec3i { +@@ -144,16 +149,16 @@ public class SectionPos extends Vec3i { return this.getZ(); } @@ -158,7 +158,7 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde } public int maxBlockX() { -@@ -168,7 +173,8 @@ public class SectionPos extends Vec3i { +@@ -169,7 +174,8 @@ public class SectionPos extends Vec3i { } public static long blockToSection(long blockPos) { @@ -168,7 +168,7 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde } public static long getZeroNode(long pos) { -@@ -192,15 +198,18 @@ public class SectionPos extends Vec3i { +@@ -193,15 +199,18 @@ public class SectionPos extends Vec3i { return asLong(blockToSectionCoord(pos.getX()), blockToSectionCoord(pos.getY()), blockToSectionCoord(pos.getZ())); } @@ -180,8 +180,8 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde + public static long asLong(int x, int y, int z) { - long l = 0L; -- l = l | ((long)x & 4194303L) << 42; -- l = l | ((long)y & 1048575L) << 0; +- l |= ((long)x & 4194303L) << 42; +- l |= ((long)y & 1048575L) << 0; - return l | ((long)z & 4194303L) << 20; + return (((long) x & 4194303L) << 42) | (((long) y & 1048575L)) | (((long) z & 4194303L) << 20); // Paper - Simplify to reduce instruction count } @@ -192,7 +192,7 @@ index 4ea92289304bdad469e67164442bc0b837183e8a..b0c39895e10fab5acc609128d34aafde } @Override -@@ -213,16 +222,11 @@ public class SectionPos extends Vec3i { +@@ -214,16 +223,11 @@ public class SectionPos extends Vec3i { } public static Stream cube(SectionPos center, int radius) { diff --git a/patches/unapplied/server/0454-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/0450-Add-Plugin-Tickets-to-API-Chunk-Methods.patch similarity index 95% rename from patches/unapplied/server/0454-Add-Plugin-Tickets-to-API-Chunk-Methods.patch rename to patches/server/0450-Add-Plugin-Tickets-to-API-Chunk-Methods.patch index d05a7239ba..7ed957bd85 100644 --- a/patches/unapplied/server/0454-Add-Plugin-Tickets-to-API-Chunk-Methods.patch +++ b/patches/server/0450-Add-Plugin-Tickets-to-API-Chunk-Methods.patch @@ -22,10 +22,10 @@ wants it to collect even faster, they can restore that setting back to 1 instead Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index acae4ffc1e97ba54056b7b30679404de6ff54fca..cb08173bdfe52c8a0d5de70f0421cabaa476647a 100644 +index 835ff36cfd8c15bf11b3b6a70eb02f6c5b693b8a..b1dfd1b13652807882e057ae4fb55f9a045d1a16 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -369,7 +369,7 @@ public final class CraftServer implements Server { +@@ -373,7 +373,7 @@ public final class CraftServer implements Server { this.ambientSpawn = this.configuration.getInt("spawn-limits.ambient"); console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); @@ -34,7 +34,7 @@ index acae4ffc1e97ba54056b7b30679404de6ff54fca..cb08173bdfe52c8a0d5de70f0421caba this.minimumAPI = this.configuration.getString("settings.minimum-api"); this.loadIcon(); } -@@ -860,7 +860,7 @@ public final class CraftServer implements Server { +@@ -903,7 +903,7 @@ public final class CraftServer implements Server { this.waterUndergroundCreatureSpawn = this.configuration.getInt("spawn-limits.water-underground-creature"); this.ambientSpawn = this.configuration.getInt("spawn-limits.ambient"); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); @@ -44,7 +44,7 @@ index acae4ffc1e97ba54056b7b30679404de6ff54fca..cb08173bdfe52c8a0d5de70f0421caba this.printSaveWarning = false; console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 01ac6e7e7b4b6c61d01684c77ecc2238afcaa8f1..20d956c9a4e3b598ffebbe481a190158566343d9 100644 +index c4d5d78064cbef9386c00dc962e0a7889ed73d9d..3bc98586792960f50ca25929f1d91fc60a8577ce 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -264,8 +264,21 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/unapplied/server/0472-Stop-copy-on-write-operations-for-updating-light-dat.patch b/patches/server/0451-Stop-copy-on-write-operations-for-updating-light-dat.patch similarity index 96% rename from patches/unapplied/server/0472-Stop-copy-on-write-operations-for-updating-light-dat.patch rename to patches/server/0451-Stop-copy-on-write-operations-for-updating-light-dat.patch index 37247d74e2..3fe4a3693e 100644 --- a/patches/unapplied/server/0472-Stop-copy-on-write-operations-for-updating-light-dat.patch +++ b/patches/server/0451-Stop-copy-on-write-operations-for-updating-light-dat.patch @@ -113,7 +113,7 @@ index 67ff66e232592203cf8dad605ad01eabc4dded89..f357a3473682c2d37a20fb862522c67b public void clearCache() { diff --git a/src/main/java/net/minecraft/world/level/lighting/LayerLightSectionStorage.java b/src/main/java/net/minecraft/world/level/lighting/LayerLightSectionStorage.java -index ee32aba07aad4a3f101a6a57f7aa6c07f74dd0c3..cc9eb8273d5157fb649d84a3ec589b0b923b5bc9 100644 +index 99a758341d4b31cb1703fdce0a257f65ed602ca0..4f7b63f2cc8a69fa8efb3a84f6abc3d3dcf05b49 100644 --- a/src/main/java/net/minecraft/world/level/lighting/LayerLightSectionStorage.java +++ b/src/main/java/net/minecraft/world/level/lighting/LayerLightSectionStorage.java @@ -28,7 +28,7 @@ public abstract class LayerLightSectionStorage> @@ -153,7 +153,7 @@ index ee32aba07aad4a3f101a6a57f7aa6c07f74dd0c3..cc9eb8273d5157fb649d84a3ec589b0b } @Nullable -@@ -346,9 +354,11 @@ public abstract class LayerLightSectionStorage> +@@ -343,9 +351,11 @@ public abstract class LayerLightSectionStorage> protected void swapSectionMap() { if (!this.changedSections.isEmpty()) { @@ -167,7 +167,7 @@ index ee32aba07aad4a3f101a6a57f7aa6c07f74dd0c3..cc9eb8273d5157fb649d84a3ec589b0b } diff --git a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -index c436ba1f09f6034679dc3dc7af28c00776e165f2..24030bcb3303d0419c7859ded7613608c5f82308 100644 +index 1f6ed4309f0f5e06cd2981864feaa6ea16df0350..9797254e981d08d3934f7ca8f369dd78a6ef1a48 100644 --- a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java +++ b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java @@ -21,7 +21,7 @@ public class SkyLightSectionStorage extends LayerLightSectionStoragewill throw an NPE. */ public UUID getUUID(String key) { @@ -46,55 +46,44 @@ index 5456387ade8932fb0d9804abe0fd66f1c565e1ae..7199be3b9c00c66f452e92ad35795017 return tag != null && tag.getType() == IntArrayTag.TYPE && ((IntArrayTag)tag).getAsIntArray().length == 4; } diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java -index 57c9575a9714acb95d9dced672955a96d71dfd1e..06fe97e05608fc21f90c9884d745d910beb6883d 100644 +index a61f480bc2e2169969e614bccd3e143f47c1a40e..b77b806b28dfada3e84e25d868aa8a8f8556f5af 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java +++ b/src/main/java/net/minecraft/nbt/NbtUtils.java @@ -40,14 +40,14 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public final class NbtUtils { -- private static final Comparator YXZ_LISTTAG_INT_COMPARATOR = Comparator.comparingInt((listTag) -> { -+ private static final Comparator YXZ_LISTTAG_INT_COMPARATOR = Comparator.comparingInt((listTag) -> { // Paper - decompile fix - return listTag.getInt(1); - }).thenComparingInt((listTag) -> { - return listTag.getInt(0); - }).thenComparingInt((listTag) -> { - return listTag.getInt(2); +- 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((listTag) -> { -+ private static final Comparator YXZ_LISTTAG_DOUBLE_COMPARATOR = Comparator.comparingDouble((listTag) -> { // Paper - decompile fix - return listTag.getDouble(1); - }).thenComparingDouble((listTag) -> { - return listTag.getDouble(0); -@@ -76,6 +76,11 @@ public final class NbtUtils { +- 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); +@@ -75,6 +75,11 @@ public final class NbtUtils { + if (compound.contains("Name", 8)) { string = compound.getString("Name"); } - + // Paper start - support string UUID's + if (compound.contains("Id", 8)) { + uUID = UUID.fromString(compound.getString("Id")); + } + // Paper end + if (compound.hasUUID("Id")) { uUID = compound.getUUID("Id"); - } @@ -495,7 +500,7 @@ 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 com.mojang.serialization.Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); // Paper - decompile fix ++ return (CompoundTag) fixer.update(fixTypes.getType(), new Dynamic<>(NbtOps.INSTANCE, compound), oldVersion, targetVersion).getValue(); // Paper - decompile fix } public static Component toPrettyComponent(Tag element) { -@@ -620,8 +625,8 @@ public final class NbtUtils { - CompoundTag compoundTag2 = new CompoundTag(); - if (i + 2 <= string.length()) { - String string3 = string.substring(i + 1, string.indexOf(125, i)); -- COMMA_SPLITTER.split(string3).forEach((string2) -> { -- List list = COLON_SPLITTER.splitToList(string2); -+ COMMA_SPLITTER.split(string3).forEach(it -> { // Paper - decompile fix -+ List list = COLON_SPLITTER.splitToList(it); // Paper - decompile fix - if (list.size() == 2) { - compoundTag2.putString(list.get(0), list.get(1)); - } else { diff --git a/patches/unapplied/server/0474-Clean-up-duplicated-GameProfile-Properties.patch b/patches/server/0453-Clean-up-duplicated-GameProfile-Properties.patch similarity index 96% rename from patches/unapplied/server/0474-Clean-up-duplicated-GameProfile-Properties.patch rename to patches/server/0453-Clean-up-duplicated-GameProfile-Properties.patch index 811c919be7..d9c0d0a1c7 100644 --- a/patches/unapplied/server/0474-Clean-up-duplicated-GameProfile-Properties.patch +++ b/patches/server/0453-Clean-up-duplicated-GameProfile-Properties.patch @@ -9,7 +9,7 @@ growing to large sizes and preventing login. This now automatically cleans up the extra properties. diff --git a/src/main/java/net/minecraft/nbt/NbtUtils.java b/src/main/java/net/minecraft/nbt/NbtUtils.java -index 06fe97e05608fc21f90c9884d745d910beb6883d..dca8853944832e8fc5a291aa6b46d84b24181ea7 100644 +index b77b806b28dfada3e84e25d868aa8a8f8556f5af..97c5e6c70cd9f96bc229557a425fbffbf489910e 100644 --- a/src/main/java/net/minecraft/nbt/NbtUtils.java +++ b/src/main/java/net/minecraft/nbt/NbtUtils.java @@ -93,7 +93,8 @@ public final class NbtUtils { diff --git a/patches/unapplied/server/0475-Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/0454-Convert-legacy-attributes-in-Item-Meta.patch similarity index 97% rename from patches/unapplied/server/0475-Convert-legacy-attributes-in-Item-Meta.patch rename to patches/server/0454-Convert-legacy-attributes-in-Item-Meta.patch index 373747c12d..1225ad8355 100644 --- a/patches/unapplied/server/0475-Convert-legacy-attributes-in-Item-Meta.patch +++ b/patches/server/0454-Convert-legacy-attributes-in-Item-Meta.patch @@ -30,7 +30,7 @@ index 0520c45197629cbdc2777d9ae11eef572e793160..46c313d581b9af6aa0a48f97ae3cc800 public CraftAttributeMap(AttributeMap handle) { this.handle = handle; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 0aa7854119ab876f0e46bb7667282d79d2a57e3d..3a125e7018b57aa6a802e99662fa784493fec5fc 100644 +index 9d4685698ed707239b071a366eebbc4b8450683c..9ef1da08fe1b0ff8146c4931139eee9a2c6d5f12 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -480,7 +480,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { diff --git a/patches/server/0455-Remove-some-streams-from-structures.patch b/patches/server/0455-Remove-some-streams-from-structures.patch new file mode 100644 index 0000000000..b4ec016db8 --- /dev/null +++ b/patches/server/0455-Remove-some-streams-from-structures.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: JRoy +Date: Mon, 29 Jun 2020 17:03:06 -0400 +Subject: [PATCH] Remove some streams from structures + +This showed up a lot in the spark profiler, should have a low-medium performance improvement. + +diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java +index 1de44cc8d3e030421ad50a732bfe569f569655f0..98c4ddb261b6a17f6b8fc269c98add92688cae96 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java +@@ -16,6 +16,7 @@ import net.minecraft.world.level.levelgen.feature.structures.StructureTemplatePo + import net.minecraft.world.level.levelgen.structure.BoundingBox; + import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece; + import net.minecraft.world.level.levelgen.structure.StructurePiece; ++import net.minecraft.world.level.levelgen.structure.StructureStart; + + public class Beardifier implements NoiseChunk.NoiseFiller { + public static final int BEARD_KERNEL_RADIUS = 12; +@@ -43,7 +44,7 @@ public class Beardifier implements NoiseChunk.NoiseFiller { + this.rigids = new ObjectArrayList<>(10); + + for(StructureFeature structureFeature : StructureFeature.NOISE_AFFECTING_FEATURES) { +- structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature).forEach((structureStart) -> { ++ for (StructureStart structureStart : structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature)) { // Paper - remove streams + for(StructurePiece structurePiece : structureStart.getPieces()) { + if (structurePiece.isCloseToChunk(chunkPos, 12)) { + if (structurePiece instanceof PoolElementStructurePiece) { +@@ -66,7 +67,7 @@ public class Beardifier implements NoiseChunk.NoiseFiller { + } + } + +- }); ++ } // Paper + } + + this.pieceIterator = this.rigids.iterator(); diff --git a/patches/unapplied/server/0477-Remove-streams-from-classes-related-villager-gossip.patch b/patches/server/0456-Remove-streams-from-classes-related-villager-gossip.patch similarity index 97% rename from patches/unapplied/server/0477-Remove-streams-from-classes-related-villager-gossip.patch rename to patches/server/0456-Remove-streams-from-classes-related-villager-gossip.patch index 3281f024d6..c2d659c679 100644 --- a/patches/unapplied/server/0477-Remove-streams-from-classes-related-villager-gossip.patch +++ b/patches/server/0456-Remove-streams-from-classes-related-villager-gossip.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove streams from classes related villager gossip diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java -index 01df536b3b61281828ca2be03ac1bbb6a1096423..2d124ff784b943f5a9d164ee7cdc001465502ce4 100644 +index 5498ec7049318dc2d10bb2ef7fbfefcf1e6e1e72..d45d14394320e87513f70a9e821fb7d179450cd9 100644 --- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java +++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java @@ -8,6 +8,7 @@ import com.mojang.serialization.Dynamic; diff --git a/patches/unapplied/server/0478-Optimize-NibbleArray-to-use-pooled-buffers.patch b/patches/server/0457-Optimize-NibbleArray-to-use-pooled-buffers.patch similarity index 66% rename from patches/unapplied/server/0478-Optimize-NibbleArray-to-use-pooled-buffers.patch rename to patches/server/0457-Optimize-NibbleArray-to-use-pooled-buffers.patch index 6c66543ad7..e7993e3588 100644 --- a/patches/unapplied/server/0478-Optimize-NibbleArray-to-use-pooled-buffers.patch +++ b/patches/server/0457-Optimize-NibbleArray-to-use-pooled-buffers.patch @@ -8,26 +8,91 @@ an object pool for these. Uses lots of advanced new capabilities of the Paper codebase :) -diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java -index 24d5a44cb81ec5f10bfcce002a193f4566de88fc..d8be2ad889f46491e50404916fb4ae0de5f42098 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLightUpdatePacket.java -@@ -2,11 +2,14 @@ package net.minecraft.network.protocol.game; +diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java +index 079734654c0fd421561b5f9003cd318bad5787a9..a15dbd37bf810c89b751710537203d6bf1d085bc 100644 +--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java ++++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket.java +@@ -2,8 +2,11 @@ package net.minecraft.network.protocol.game; - import com.google.common.collect.Lists; import java.util.BitSet; -+import io.netty.channel.ChannelFuture; // Paper - import java.util.List; import javax.annotation.Nullable; - import net.minecraft.core.SectionPos; ++ ++import io.netty.channel.ChannelFuture; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.protocol.Packet; -+import net.minecraft.server.MCUtil; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.ChunkPos; - import net.minecraft.world.level.LightLayer; - import net.minecraft.world.level.chunk.DataLayer; -@@ -22,6 +25,35 @@ public class ClientboundLightUpdatePacket implements Packet skyUpdates; private final List blockUpdates; private final boolean trustEdges; @@ -36,16 +101,14 @@ index 24d5a44cb81ec5f10bfcce002a193f4566de88fc..d8be2ad889f46491e50404916fb4ae0d + java.lang.Runnable cleaner2; + java.util.concurrent.atomic.AtomicInteger remainingSends = new java.util.concurrent.atomic.AtomicInteger(0); + -+ @Override -+ public void onPacketDispatch(ServerPlayer player) { ++ public void onPacketDispatch(net.minecraft.server.level.ServerPlayer player) { + remainingSends.incrementAndGet(); + } + -+ @Override -+ public void onPacketDispatchFinish(ServerPlayer player, ChannelFuture future) { ++ public void onPacketDispatchFinish(net.minecraft.server.level.ServerPlayer player, io.netty.channel.ChannelFuture future) { + if (remainingSends.decrementAndGet() <= 0) { + // incase of any race conditions, schedule this delayed -+ MCUtil.scheduleTask(5, () -> { ++ net.minecraft.server.MCUtil.scheduleTask(5, () -> { + if (remainingSends.get() == 0) { + cleaner1.run(); + cleaner2.run(); @@ -53,38 +116,32 @@ index 24d5a44cb81ec5f10bfcce002a193f4566de88fc..d8be2ad889f46491e50404916fb4ae0d + }, "Light Packet Release"); + } + } -+ -+ @Override -+ public boolean hasFinishListener() { -+ return true; -+ } -+ + // Paper end - public ClientboundLightUpdatePacket(ChunkPos chunkPos, LevelLightEngine lightProvider, @Nullable BitSet bitSet, @Nullable BitSet bitSet2, boolean nonEdge) { - this.x = chunkPos.x; -@@ -31,8 +63,8 @@ public class ClientboundLightUpdatePacket implements Packet> +@@ -157,7 +157,7 @@ public abstract class LayerLightSectionStorage> protected DataLayer createDataLayer(long sectionPos) { DataLayer dataLayer = this.queuedSections.get(sectionPos); @@ -244,13 +301,13 @@ index cc9eb8273d5157fb649d84a3ec589b0b923b5bc9..fd1cdb6e2023713f947b9497c605cf6f } protected void clearQueuedSectionBlocks(LayerLightEngine storage, long sectionPos) { -@@ -321,12 +321,12 @@ public abstract class LayerLightSectionStorage> +@@ -318,12 +318,12 @@ public abstract class LayerLightSectionStorage> - protected void queueSectionData(long sectionPos, @Nullable DataLayer array, boolean bl) { + protected void queueSectionData(long sectionPos, @Nullable DataLayer array, boolean nonEdge) { if (array != null) { - this.queuedSections.put(sectionPos, array); + DataLayer remove = this.queuedSections.put(sectionPos, array); if (remove != null && remove.cleaner != null) remove.cleaner.run(); // Paper - clean up when removed - if (!bl) { + if (!nonEdge) { this.untrustedSections.add(sectionPos); } } else { @@ -260,7 +317,7 @@ index cc9eb8273d5157fb649d84a3ec589b0b923b5bc9..fd1cdb6e2023713f947b9497c605cf6f } diff --git a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java -index 24030bcb3303d0419c7859ded7613608c5f82308..ec3837a64e8ac6892028611d57a111a7fd5c58f7 100644 +index 9797254e981d08d3934f7ca8f369dd78a6ef1a48..4012d87dc27c3b1096fdaa60bfdfd68f27a22da7 100644 --- a/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java +++ b/src/main/java/net/minecraft/world/level/lighting/SkyLightSectionStorage.java @@ -163,14 +163,14 @@ public class SkyLightSectionStorage extends LayerLightSectionStorage extends Behavior { @@ -16,7 +16,7 @@ index 6ee0098de2b55a437f914869643adbd1ddbe7faf..4b2e0379d9bbeb12c104e52817bb2005 if (!entity.canAttack(entityliving)) { - this.clearAttackTarget(entity); + this.clearAttackTarget(entity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_INVALID); // Paper - } else if (StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget((LivingEntity) entity)) { + } else if (StopAttackingIfTargetInvalid.isTiredOfTryingToReachTarget(entity)) { - this.clearAttackTarget(entity); + this.clearAttackTarget(entity, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FORGOT_TARGET); // Paper } else if (this.isCurrentTargetDeadOrRemoved(entity)) { diff --git a/patches/unapplied/server/0481-Add-entity-liquid-API.patch b/patches/server/0460-Add-entity-liquid-API.patch similarity index 86% rename from patches/unapplied/server/0481-Add-entity-liquid-API.patch rename to patches/server/0460-Add-entity-liquid-API.patch index 7ad6c6e8c3..5610f8671a 100644 --- a/patches/unapplied/server/0481-Add-entity-liquid-API.patch +++ b/patches/server/0460-Add-entity-liquid-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add entity liquid API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 19a6b2c686e6421624282d0536dfdd3320da4ec6..3e1f34ed8c3b4bd4f6c3624332a5f2be62e196fe 100644 +index 4c506e2bf241ba9d6dd53b54def09be09303664b..91e034f54deb2aa084527aaa001e48ddcc2e9cd1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1365,7 +1365,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -1359,7 +1359,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i return this.isInWater() || this.isInRain(); } @@ -17,7 +17,7 @@ index 19a6b2c686e6421624282d0536dfdd3320da4ec6..3e1f34ed8c3b4bd4f6c3624332a5f2be return this.isInWater() || this.isInRain() || this.isInBubbleColumn(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index c9e716900d88d025be1f09b6fe0156cf0dac2d33..f28f857d6218db1634348e8a57e7b275b9115bfc 100644 +index fd811e2ba455d7e4eb618d48ca2c4983797a265c..38e38abd5302a9f8c5eb2d3d81d825cdae99d7c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1235,5 +1235,29 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0482-Update-itemstack-legacy-name-and-lore.patch b/patches/server/0461-Update-itemstack-legacy-name-and-lore.patch similarity index 94% rename from patches/unapplied/server/0482-Update-itemstack-legacy-name-and-lore.patch rename to patches/server/0461-Update-itemstack-legacy-name-and-lore.patch index 335e79f32e..105db03eec 100644 --- a/patches/unapplied/server/0482-Update-itemstack-legacy-name-and-lore.patch +++ b/patches/server/0461-Update-itemstack-legacy-name-and-lore.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Update itemstack legacy name and lore diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 1f93ad93701339418b554eb3e1e3f74e62468f3f..e643f925623820ffa67217eb3615582c0d0ca3a5 100644 +index 3d6d48ce4b762091aeee3b4fdd28bd121aaf291b..a18cf051b374cbf294e319b619b7e2fba10a6268 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -168,6 +168,44 @@ public final class ItemStack { @@ -54,7 +54,7 @@ index 1f93ad93701339418b554eb3e1e3f74e62468f3f..e643f925623820ffa67217eb3615582c public ItemStack(ItemLike item) { @@ -214,6 +252,7 @@ public final class ItemStack { - this.tag = (CompoundTag) nbttagcompound.getCompound("tag").copy(); + this.tag = nbttagcompound.getCompound("tag").copy(); // CraftBukkit end this.processEnchantOrder(this.tag); // Paper + this.processText(); // Paper diff --git a/patches/unapplied/server/0483-Spawn-player-in-correct-world-on-login.patch b/patches/server/0462-Spawn-player-in-correct-world-on-login.patch similarity index 94% rename from patches/unapplied/server/0483-Spawn-player-in-correct-world-on-login.patch rename to patches/server/0462-Spawn-player-in-correct-world-on-login.patch index bb38fbd9c4..62e6bab623 100644 --- a/patches/unapplied/server/0483-Spawn-player-in-correct-world-on-login.patch +++ b/patches/server/0462-Spawn-player-in-correct-world-on-login.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Spawn player in correct world on login diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index f5334be5d9c799da16198ecb0f69f17a2bf4a1eb..e0c9857a922d8a3f421d7df0f056b82c4775390e 100644 +index c2cc59f476a67224774503009439fec2ad1ec62d..0ac5ba6bc7b582d1ab02a90c9418c9b899175d93 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -196,7 +196,18 @@ public abstract class PlayerList { diff --git a/patches/unapplied/server/0484-Add-PrepareResultEvent.patch b/patches/server/0463-Add-PrepareResultEvent.patch similarity index 90% rename from patches/unapplied/server/0484-Add-PrepareResultEvent.patch rename to patches/server/0463-Add-PrepareResultEvent.patch index ba54754ac2..14a6bd3437 100644 --- a/patches/unapplied/server/0484-Add-PrepareResultEvent.patch +++ b/patches/server/0463-Add-PrepareResultEvent.patch @@ -8,10 +8,10 @@ Adds a new event for all crafting stations that generate a result slot item Anvil, Grindstone and Smithing now extend this event diff --git a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -index 2ed4930648411ccd52fc970b069e57eba9bceef8..593e23c10f2b1616db7256158dfe564b2d289df1 100644 +index 6b9c39b85e3a21fc0073fc15c8a76c92f75d2487..b40377e882d9cc3571f527e706862e27c59b1fd0 100644 --- a/src/main/java/net/minecraft/world/inventory/AnvilMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AnvilMenu.java -@@ -317,6 +317,7 @@ public class AnvilMenu extends ItemCombinerMenu { +@@ -316,6 +316,7 @@ public class AnvilMenu extends ItemCombinerMenu { } this.createResult(); @@ -20,7 +20,7 @@ index 2ed4930648411ccd52fc970b069e57eba9bceef8..593e23c10f2b1616db7256158dfe564b public int getCost() { diff --git a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java -index 93ebd73b94efac5f671b0459e0075959f5ce8bdf..aaf67ac2a73fa3b4420ec99ee185bceda2cb4c2b 100644 +index fc2b400c58ddbd7b012707c61d9a37363d351251..35e13a5fc23fc0cc046345059b43b37b348a3803 100644 --- a/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java +++ b/src/main/java/net/minecraft/world/inventory/CartographyTableMenu.java @@ -150,6 +150,7 @@ public class CartographyTableMenu extends AbstractContainerMenu { @@ -32,10 +32,10 @@ index 93ebd73b94efac5f671b0459e0075959f5ce8bdf..aaf67ac2a73fa3b4420ec99ee185bced private void setupResultSlot(ItemStack map, ItemStack item, ItemStack oldResult) { diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index b268645827b7a57b906fd925d694f802a75da25d..dda6c4948b903221fa8020c76d109216d2dd82bf 100644 +index aa0ba9c7dcb0ee81c9081031c447eeab61d92a10..aa47947ea2f04afd3cca4b359891609025c112d5 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -@@ -160,6 +160,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { +@@ -159,6 +159,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { super.slotsChanged(inventory); if (inventory == this.repairSlots) { this.createResult(); @@ -44,7 +44,7 @@ index b268645827b7a57b906fd925d694f802a75da25d..dda6c4948b903221fa8020c76d109216 } diff --git a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java -index 8819347987a8072eede52a57fec763711d9bab92..9cc246f43230e87c6bd2377ef77ab2dcb9509a5c 100644 +index f5e52220abc5c678c090b32d83eb9644fa91ce9d..0a30b051e2fb4f081d0d579b30732aa8289c3389 100644 --- a/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/ItemCombinerMenu.java @@ -78,6 +78,7 @@ public abstract class ItemCombinerMenu extends AbstractContainerMenu { @@ -56,10 +56,10 @@ index 8819347987a8072eede52a57fec763711d9bab92..9cc246f43230e87c6bd2377ef77ab2dc } diff --git a/src/main/java/net/minecraft/world/inventory/LoomMenu.java b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -index b490e87d95c3a140323aa9da95b90381392f64f8..9bcab01324612a905b21623a09109d404f8dadf7 100644 +index 5d9e444793bc9995f669596e699ace095ae3cb2b..fba8c59071847d9669943534ff8a0898b5787c28 100644 --- a/src/main/java/net/minecraft/world/inventory/LoomMenu.java +++ b/src/main/java/net/minecraft/world/inventory/LoomMenu.java -@@ -196,7 +196,8 @@ public class LoomMenu extends AbstractContainerMenu { +@@ -198,7 +198,8 @@ public class LoomMenu extends AbstractContainerMenu { } this.setupResultSlot(); @@ -82,7 +82,7 @@ index 92dd2ea23185bba311e184b2ac9744a423c102ea..cb3f522a586b841056c35378a49dd50b @Override diff --git a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java -index 3df5031ec2c50dc6eb2533318cf8a98f21b03d2a..c971a534ded962e3be92c71059c75cc1d54970b5 100644 +index cdebd0cdf6eb901464cf4c16089b10ea0147b54d..221b6ffb426edc034183dbaf37de29c694874c62 100644 --- a/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java +++ b/src/main/java/net/minecraft/world/inventory/StonecutterMenu.java @@ -176,6 +176,7 @@ public class StonecutterMenu extends AbstractContainerMenu { @@ -94,7 +94,7 @@ index 3df5031ec2c50dc6eb2533318cf8a98f21b03d2a..c971a534ded962e3be92c71059c75cc1 private void setupRecipeList(Container input, ItemStack stack) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index ff2149572a82d6605a0b28f2fdd0dadb86af25a1..869990c181403a025d219dbd0e1201005973ffe9 100644 +index 5fea023590fd1456a4d43c1ebc5b8c243e185631..1c0bf20f19a697e588a1d0210c181d29edbcaba7 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1556,19 +1556,44 @@ public class CraftEventFactory { diff --git a/patches/unapplied/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/patches/server/0465-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch similarity index 84% rename from patches/unapplied/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch rename to patches/server/0465-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index c3db540373..7da33864aa 100644 --- a/patches/unapplied/server/0486-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/patches/server/0465-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index fab8098ce72feb9b08960e55ab1a4aebaae22276..2e7d7bd60ac340568b1bc0f3052affcf445090f7 100644 +index 6c4fd054a06830947dbb4728e62dc320a51f43f0..2e02fc6d9c54bd246602b8535553dd04c4e26679 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3359,7 +3359,7 @@ public abstract class LivingEntity extends Entity { +@@ -3362,7 +3362,7 @@ public abstract class LivingEntity extends Entity { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - suppress diff --git a/patches/unapplied/server/0476-Remove-some-streams-from-structures.patch b/patches/unapplied/server/0476-Remove-some-streams-from-structures.patch deleted file mode 100644 index 072f341f2a..0000000000 --- a/patches/unapplied/server/0476-Remove-some-streams-from-structures.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: JRoy -Date: Mon, 29 Jun 2020 17:03:06 -0400 -Subject: [PATCH] Remove some streams from structures - -This showed up a lot in the spark profiler, should have a low-medium performance improvement. - -diff --git a/src/main/java/net/minecraft/world/level/StructureFeatureManager.java b/src/main/java/net/minecraft/world/level/StructureFeatureManager.java -index 21f67cf20dede30a056a7807a0e7338e858da142..9a8e44fb3b1cffec3f70c9812c80175bd07f10e2 100644 ---- a/src/main/java/net/minecraft/world/level/StructureFeatureManager.java -+++ b/src/main/java/net/minecraft/world/level/StructureFeatureManager.java -@@ -45,6 +45,20 @@ public class StructureFeatureManager { - }); - } - -+ // Paper start - remove structure streams - based on method above -+ public java.util.List> streamlessStartsForFeature(SectionPos sectionPosition, StructureFeature structureGenerator) { -+ java.util.List> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>(); -+ for (Long curLong : this.level.getChunk(sectionPosition.x(), sectionPosition.z(), ChunkStatus.STRUCTURE_REFERENCES).getReferencesForFeature(structureGenerator)) { -+ SectionPos sectionPosition1 = SectionPos.of(new ChunkPos(curLong), 0); -+ StructureStart structurestart = getStartForFeature(sectionPosition1, structureGenerator, this.level.getChunk(sectionPosition1.x(), sectionPosition1.z(), ChunkStatus.STRUCTURE_STARTS)); -+ if (structurestart != null && structurestart.isValid()) { -+ list.add(structurestart); -+ } -+ } -+ return list; -+ } -+ // Paper end -+ - @Nullable - public StructureStart getStartForFeature(SectionPos pos, StructureFeature feature, FeatureAccess holder) { - return holder.getStartForFeature(feature); -@@ -63,11 +77,20 @@ public class StructureFeatureManager { - } - - public StructureStart getStructureAt(BlockPos pos, boolean matchChildren, StructureFeature feature) { -- return (StructureStart) DataFixUtils.orElse(this.startsForFeature(SectionPos.of(pos), feature).filter((structurestart) -> { -- return matchChildren ? structurestart.getPieces().stream().anyMatch((structurepiece) -> { -- return structurepiece.getBoundingBox().isInside((Vec3i) pos); -- }) : structurestart.getBoundingBox().isInside((Vec3i) pos); -- }).findFirst(), StructureStart.INVALID_START); -+ // Paper start - remove structure streams -+ for (StructureStart structureStart : streamlessStartsForFeature(SectionPos.of(pos), feature)) { -+ if (matchChildren) { -+ for (net.minecraft.world.level.levelgen.structure.StructurePiece piece : structureStart.getPieces()) { -+ if (piece.getBoundingBox().isInside(pos)) { -+ return structureStart; -+ } -+ } -+ } else if (structureStart.getBoundingBox().isInside(pos)) { -+ return structureStart; -+ } -+ } -+ return StructureStart.INVALID_START; -+ // Paper end - } - - // Spigot start -diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java -index 3f3b4e4ea8231fdcc799bd9de3e20747a5634603..a7a7e6cd87270e64a92448f03f8b0b0c7e375ec7 100644 ---- a/src/main/java/net/minecraft/world/level/biome/Biome.java -+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java -@@ -44,6 +44,7 @@ import net.minecraft.world.level.levelgen.WorldgenRandom; - import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; - import net.minecraft.world.level.levelgen.feature.StructureFeature; - import net.minecraft.world.level.levelgen.structure.BoundingBox; -+import net.minecraft.world.level.levelgen.structure.StructureStart; - import net.minecraft.world.level.levelgen.surfacebuilders.ConfiguredSurfaceBuilder; - import net.minecraft.world.level.levelgen.synth.PerlinSimplexNoise; - import net.minecraft.world.level.material.FluidState; -@@ -241,9 +242,11 @@ public final class Biome { - int p = region.getMinBuildHeight() + 1; - int q = region.getMaxBuildHeight() - 1; - region.setCurrentlyGenerating(supplier); -- structureAccessor.startsForFeature(SectionPos.of(origin), structureFeature).forEach((structureStart) -> { -+ // Paper start - remove structure streams -+ for (StructureStart structureStart : structureAccessor.streamlessStartsForFeature(SectionPos.of(origin), structureFeature)) { - structureStart.placeInChunk(region, structureAccessor, chunkGenerator, random, new BoundingBox(n, p, o, n + 15, q, o + 15), new ChunkPos(l, m)); -- }); -+ } -+ // Paper end - } catch (Exception var24) { - CrashReport crashReport = CrashReport.forThrowable(var24, "Feature placement"); - crashReport.addCategory("Feature").setDetail("Description", supplier::get); -diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java -index ed3bfe13d0e3835ce0dbe3ae5af8cd22a7ea25e6..c52d1a23a0f0bdde062f73a435bc6b9cef51c437 100644 ---- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java -+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java -@@ -44,7 +44,7 @@ public class Beardifier { - this.rigids = new ObjectArrayList<>(10); - - for(StructureFeature structureFeature : StructureFeature.NOISE_AFFECTING_FEATURES) { -- accessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature).forEach((start) -> { -+ for (net.minecraft.world.level.levelgen.structure.StructureStart start : accessor.streamlessStartsForFeature(SectionPos.of(chunkPos, 0), structureFeature)) { // Paper - remove structure streams - for(StructurePiece structurePiece : start.getPieces()) { - if (structurePiece.isCloseToChunk(chunkPos, 12)) { - if (structurePiece instanceof PoolElementStructurePiece) { -@@ -67,7 +67,7 @@ public class Beardifier { - } - } - -- }); -+ } // Paper - remove structure streams - } - - this.pieceIterator = this.rigids.iterator();