diff --git a/build-data/paper.at b/build-data/paper.at index c521dc49df..f486c0ba68 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -183,3 +183,11 @@ public net.minecraft.Util$IdentityStrategy # Chunk priority urgency system public net.minecraft.server.level.ChunkMap$ChunkDistanceManager + +# Here's Johnny +public net.minecraft.world.entity.monster.Vindicator isJohnny + +# Chunk debug command +public net.minecraft.server.level.Ticket createdTick +public net.minecraft.server.level.ServerChunkCache CHUNK_STATUSES +public net.minecraft.server.level.ChunkHolder pos diff --git a/patches/server/0006-MC-Utils.patch b/patches/server/0006-MC-Utils.patch index d94c640b6c..ff560e63a1 100644 --- a/patches/server/0006-MC-Utils.patch +++ b/patches/server/0006-MC-Utils.patch @@ -2258,7 +2258,7 @@ index 0000000000000000000000000000000000000000..9df0006c1a283f77c4d01d9fce9062fc + } +} diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 771e4b72589d7117a154ab6917bd4a56d55f19db..65e0ca442980f273d2fe5f131e174cd92f80da20 100644 +index eee1fce53df4a35c206364f45cbc06cca198a8a9..a44709de54fc57eec337e560dc4a699a8012c58f 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java @@ -94,7 +94,7 @@ public class Util { @@ -3048,7 +3048,7 @@ index ed9e1b4a9179a002b965a2d979b7ad0656dd1494..df32a8b1df60064c49702dca26d7310b } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index c0a769a626165e5d5d1eef6f919966976afdae48..356a79900f5ca24b2d9f9af5a1223a4309f17df9 100644 +index b48e6096b5450df94f97c4d1be3aa9bba895703d..2014ba4857e07092de4c3179149563b0ff284e56 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -55,6 +55,7 @@ import net.minecraft.network.protocol.game.ClientboundSetChunkCacheCenterPacket; @@ -3455,18 +3455,6 @@ index e06254a78334b009bf03635927361a369f8ee51a..83e71d07f86c115a0df1eb56ae9f2b12 // CraftBukkit start - multithreaded fields private AtomicInteger chatSpamTickCount = new AtomicInteger(); // CraftBukkit end -diff --git a/src/main/java/net/minecraft/util/BitStorage.java b/src/main/java/net/minecraft/util/BitStorage.java -index 65bd706ca96f5c0ec4573da9fb144fb51d2de919..3a2e8bdc215a6af604bfaad01b670a361eb8068d 100644 ---- a/src/main/java/net/minecraft/util/BitStorage.java -+++ b/src/main/java/net/minecraft/util/BitStorage.java -@@ -77,6 +77,7 @@ public class BitStorage { - return (int)(l >> j & this.mask); - } - -+ public final long[] getDataBits() { return this.getRaw(); } // Paper - OBFHELPER - public long[] getRaw() { - return this.data; - } diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java index a4c5edee297af6d68d518b77f706732b5ccbe4de..7bf4bf5cb2c1b54a7e2733091f48f3a824336d36 100644 --- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java @@ -3509,7 +3497,7 @@ index 7f3d83d3d071f6b441ad119b1c93be035e911e70..89e7d02b88404ac5dce06595432ae95c } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 1bb24476ad61c18215cde369913376d21c6e8ab6..6c4d0d584e9042e2cafac1dd29710469ac3b133e 100644 +index 595e48db4ce6064c25f3802be54ce34e87948cff..9f68aa235949520b445b368782ccde6b0e26859d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -259,6 +259,7 @@ public abstract class LivingEntity extends Entity { @@ -3906,18 +3894,6 @@ index 505731735126e81a4cc768311dce337385e5503f..549eb8a5f0f20db88abd17136f69f7bb protected abstract BlockState asState(); public boolean requiresCorrectToolForDrops() { -diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java -index a0c4bc4eb42a3d2de6f66510d88f92c06b535353..72087476c65b69c86af67424a15708c463d69a43 100644 ---- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java -+++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java -@@ -52,6 +52,7 @@ public class WorldBorder { - return this.getDistanceToBorder(entity.getX(), entity.getZ()); - } - -+ public final VoxelShape asVoxelShape(){ return getCollisionShape();} // Paper - OBFHELPER - public VoxelShape getCollisionShape() { - return this.extent.getCollisionShape(); - } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java index 62417156dd3e7e68e657f322c089fb6f30a11c0e..57f32618d6c95734fa4b45274afaf2319c7608ae 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java diff --git a/patches/server/0008-Add-MinecraftKey-Information-to-Objects.patch b/patches/server/0008-Add-MinecraftKey-Information-to-Objects.patch index c0c8c9453a..94ab20e66c 100644 --- a/patches/server/0008-Add-MinecraftKey-Information-to-Objects.patch +++ b/patches/server/0008-Add-MinecraftKey-Information-to-Objects.patch @@ -37,7 +37,7 @@ index 0000000000000000000000000000000000000000..d02bd109399d6b32cbbb5e6f9ec7e650 + } +} diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f62223f11e4be40350ca0ff0beb46fa68a1582fe..b494980b4a3303b2f19002d44f81a2707e6916a5 100644 +index 89ab5fd43a7c5057025ed50d6978dbe4301371d5..430d286a73cfdd643e85bdaa97bf91c2c74a342c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -146,7 +146,7 @@ import org.bukkit.event.player.PlayerTeleportEvent; @@ -77,23 +77,11 @@ index f62223f11e4be40350ca0ff0beb46fa68a1582fe..b494980b4a3303b2f19002d44f81a270 ResourceLocation minecraftkey = EntityType.getKey(entitytypes); - return entitytypes.canSerialize() && minecraftkey != null ? minecraftkey.toString() : null; -+ return entitytypes != null && entitytypes.isPersistable() ? getMinecraftKeyString() : null; ++ return entitytypes != null && entitytypes.canSerialize() ? getMinecraftKeyString() : null; + // Paper end } protected abstract void readAdditionalSaveData(CompoundTag nbt); -diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 89e7d02b88404ac5dce06595432ae95c9a4e5015..3ffaeb72be8cda7a2b9398b8909db5c220e8b6c9 100644 ---- a/src/main/java/net/minecraft/world/entity/EntityType.java -+++ b/src/main/java/net/minecraft/world/entity/EntityType.java -@@ -398,6 +398,7 @@ public class EntityType implements EntityTypeTest { - } - } - -+ public boolean isPersistable() { return canSerialize(); } // Paper - OBFHELPER - public boolean canSerialize() { - return this.serialize; - } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java index 33884161de688c47c90a7b86196234acc80f9434..92b042080f06fb95958ff5e824830a84f2d1f2a6 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java diff --git a/patches/server/0009-Timings-v2.patch b/patches/server/0009-Timings-v2.patch index b7a646b9e9..f70c11a225 100644 --- a/patches/server/0009-Timings-v2.patch +++ b/patches/server/0009-Timings-v2.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2 diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java new file mode 100644 -index 0000000000000000000000000000000000000000..72f9e1978394afb6e5cc1c0d085d41586d69b84e +index 0000000000000000000000000000000000000000..b47b7dce26805badd422c1867733ff4bfd00e9f4 --- /dev/null +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java @@ -0,0 +1,151 @@ @@ -158,7 +158,7 @@ index 0000000000000000000000000000000000000000..72f9e1978394afb6e5cc1c0d085d4158 + } + + public static Timing getCommandFunctionTiming(CommandFunction function) { -+ return Timings.ofSafe("Command Function - " + function.getMinecraftKey().toString()); ++ return Timings.ofSafe("Command Function - " + function.getId()); + } +} diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java @@ -720,10 +720,10 @@ index da922f395f0fff0881ead893c900c5b2623f48f0..1d03a79e9010bc514b72a81ba0ad4a62 + } } diff --git a/src/main/java/net/minecraft/commands/CommandFunction.java b/src/main/java/net/minecraft/commands/CommandFunction.java -index ca1a9884ab09fc7e575b1d30e2dd0aaff324fb73..81b36a20f57d92644a91bac9b7089ec23c211a6f 100644 +index ca1a9884ab09fc7e575b1d30e2dd0aaff324fb73..b94038e2da0f986403c1ec9b27384344e2bb22f0 100644 --- a/src/main/java/net/minecraft/commands/CommandFunction.java +++ b/src/main/java/net/minecraft/commands/CommandFunction.java -@@ -16,12 +16,22 @@ import net.minecraft.server.ServerFunctionManager; +@@ -16,6 +16,15 @@ import net.minecraft.server.ServerFunctionManager; public class CommandFunction { private final CommandFunction.Entry[] entries; final ResourceLocation id; @@ -739,13 +739,6 @@ index ca1a9884ab09fc7e575b1d30e2dd0aaff324fb73..81b36a20f57d92644a91bac9b7089ec2 public CommandFunction(ResourceLocation id, CommandFunction.Entry[] elements) { this.id = id; - this.entries = elements; - } - -+ public final ResourceLocation getMinecraftKey() { return this.getId(); } // Paper - OBFHELPER - public ResourceLocation getId() { - return this.id; - } diff --git a/src/main/java/net/minecraft/network/protocol/PacketUtils.java b/src/main/java/net/minecraft/network/protocol/PacketUtils.java index b3a6aeba2363d283f03982cf749f25cfa11a5052..449f1b2f5dca350dc0912e14c8c2bf3eb4652b92 100644 --- a/src/main/java/net/minecraft/network/protocol/PacketUtils.java @@ -1062,7 +1055,7 @@ index fe83f13d71f84591f5506e1c6b9dfbf9fba680bd..844d3b910cfb1c073b8b58b0eff3f28a } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index cbaafa2024a36fbdaf9f753c58ca974831af9fdf..39cfa8211f02acaa0851e0cfc1c2890475d609f4 100644 +index 2014ba4857e07092de4c3179149563b0ff284e56..fe785c42b6eca6dafb28ffb6b7afaf44135b3949 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1,7 +1,9 @@ @@ -1148,7 +1141,7 @@ index cbaafa2024a36fbdaf9f753c58ca974831af9fdf..39cfa8211f02acaa0851e0cfc1c28904 public void broadcast(Entity entity, Packet packet) { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index 2cc633e6d03ae37a6d0785e0a3dcc4fe9350b10a..2cea8b1e8c414c8715ce61d61168dfb9d5c2200c 100644 +index 2427b2cfb52c0e6aee1397c9951c1aa1c0f14503..8746654a1c1b3b6cb1cabb468c0498aada17d517 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -349,13 +349,15 @@ public class ServerChunkCache extends ChunkSource { @@ -1247,7 +1240,7 @@ index 2cc633e6d03ae37a6d0785e0a3dcc4fe9350b10a..2cea8b1e8c414c8715ce61d61168dfb9 private void getFullChunk(long pos, Consumer chunkConsumer) { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b6eb04733611b63916453f36abf2ae615786845c..2db7c62d25791bc7856d007e9197f8c8041f8dfa 100644 +index 0127e3ab8d4e65c802c9b44d081cc0d51946e473..94c5631820590d31cfd4e8a4fb2395dd6b395841 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1,6 +1,8 @@ @@ -1457,7 +1450,7 @@ index 01f3267c086837cbbc311d62974ecb034e429c23..34e386efda7ea52fb6f53333eda0f015 public UserWhiteList getWhiteList() { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2e90d3e79fdc5707aa5467c6270374e05b280ab3..ac1c81c964c51256c82397668b39447a36a10914 100644 +index 430d286a73cfdd643e85bdaa97bf91c2c74a342c..0b63d81ecbcb56bf3dc25661cc2b219cd8c25592 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -126,7 +126,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; @@ -1493,7 +1486,7 @@ index 2e90d3e79fdc5707aa5467c6270374e05b280ab3..ac1c81c964c51256c82397668b39447a protected void tryCheckInsideBlocks() { diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 3ffaeb72be8cda7a2b9398b8909db5c220e8b6c9..9f5f2bd9bdfce14da030b09f56c821ec1989e12f 100644 +index 89e7d02b88404ac5dce06595432ae95c9a4e5015..b7ab2844b49e97f35a04ac6c9d22ecac689f03a5 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -295,17 +295,29 @@ public class EntityType implements EntityTypeTest { @@ -1533,7 +1526,7 @@ index 3ffaeb72be8cda7a2b9398b8909db5c220e8b6c9..9f5f2bd9bdfce14da030b09f56c821ec } @Nullable -@@ -463,7 +475,6 @@ public class EntityType implements EntityTypeTest { +@@ -462,7 +474,6 @@ public class EntityType implements EntityTypeTest { return this.dimensions.height; } @@ -1541,7 +1534,7 @@ index 3ffaeb72be8cda7a2b9398b8909db5c220e8b6c9..9f5f2bd9bdfce14da030b09f56c821ec @Nullable public T create(Level world) { // Paper - OBFHELPER return this.factory.create(this, world); } -@@ -569,6 +580,12 @@ public class EntityType implements EntityTypeTest { +@@ -568,6 +579,12 @@ public class EntityType implements EntityTypeTest { return this.updateInterval; } @@ -1554,7 +1547,7 @@ index 3ffaeb72be8cda7a2b9398b8909db5c220e8b6c9..9f5f2bd9bdfce14da030b09f56c821ec public boolean trackDeltas() { return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS; } -@@ -661,7 +678,7 @@ public class EntityType implements EntityTypeTest { +@@ -660,7 +677,7 @@ public class EntityType implements EntityTypeTest { Util.fetchChoiceType(References.ENTITY_TREE, id); } @@ -1564,7 +1557,7 @@ index 3ffaeb72be8cda7a2b9398b8909db5c220e8b6c9..9f5f2bd9bdfce14da030b09f56c821ec } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3b2b57f5049d26a14e45eb4ec88a5b498005d372..ebe33c891e25c729c4373190da86c7a8198b6a55 100644 +index 9f68aa235949520b445b368782ccde6b0e26859d..67bc396d880771a135b1b95ffad79952d9a6661c 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -140,7 +140,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 3bf7b86d42..2a66c57645 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -479,7 +479,7 @@ index 0000000000000000000000000000000000000000..eeedc30a45d9637d68f04f185b3dd90d +} diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java new file mode 100644 -index 0000000000000000000000000000000000000000..f72511a71c01718be48ee6b714e902d0f41e14ae +index 0000000000000000000000000000000000000000..d24c569f00786b2bde953429aad57025abee72d6 --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java @@ -0,0 +1,342 @@ @@ -637,7 +637,7 @@ index 0000000000000000000000000000000000000000..f72511a71c01718be48ee6b714e902d0 + + public static net.minecraft.network.chat.Component asVanilla(final Component component) { + if (true) return new AdventureComponent(component); -+ return net.minecraft.network.chat.Component.Serializer.fromJsonTree(GSON.serializer().toJsonTree(component)); ++ return net.minecraft.network.chat.Component.Serializer.fromJson(GSON.serializer().toJsonTree(component)); + } + + public static List asVanilla(final List adventures) { @@ -664,7 +664,7 @@ index 0000000000000000000000000000000000000000..f72511a71c01718be48ee6b714e902d0 + if (component instanceof AdventureComponent) { + return asJsonString(((AdventureComponent) component).wrapped, locale); + } -+ return net.minecraft.network.chat.Component.Serializer.componentToJson(component); ++ return net.minecraft.network.chat.Component.Serializer.toJson(component); + } + + // thank you for being worse than wet socks, Bukkit @@ -759,7 +759,7 @@ index 0000000000000000000000000000000000000000..f72511a71c01718be48ee6b714e902d0 + tag.putString("author", asJsonString(book.author(), locale)); + final ListTag pages = new ListTag(); + for (final Component page : book.pages()) { -+ pages.add(StringTag.create(asJsonString(page, locale))); ++ pages.add(StringTag.valueOf(asJsonString(page, locale))); + } + tag.put("pages", pages); + return item; @@ -877,7 +877,7 @@ index 0000000000000000000000000000000000000000..7493efba31403cbe7f26e493f165f1b8 +} diff --git a/src/main/java/io/papermc/paper/adventure/WrapperAwareSerializer.java b/src/main/java/io/papermc/paper/adventure/WrapperAwareSerializer.java new file mode 100644 -index 0000000000000000000000000000000000000000..2e93ac0eb74a89c020f3356f77320cf6459727fd +index 0000000000000000000000000000000000000000..6b202f4b3ddbe1f5dde188136f39414dc68ae4e4 --- /dev/null +++ b/src/main/java/io/papermc/paper/adventure/WrapperAwareSerializer.java @@ -0,0 +1,19 @@ @@ -897,7 +897,7 @@ index 0000000000000000000000000000000000000000..2e93ac0eb74a89c020f3356f77320cf6 + + @Override + public net.minecraft.network.chat.Component serialize(final Component component) { -+ return net.minecraft.network.chat.Component.Serializer.fromJsonTree(PaperAdventure.GSON.serializer().toJsonTree(component)); ++ return net.minecraft.network.chat.Component.Serializer.fromJson(PaperAdventure.GSON.serializer().toJsonTree(component)); + } +} diff --git a/src/main/java/net/kyori/adventure/bossbar/HackyBossBarPlatformBridge.java b/src/main/java/net/kyori/adventure/bossbar/HackyBossBarPlatformBridge.java @@ -943,25 +943,17 @@ index 0000000000000000000000000000000000000000..2dc92d8d2764d3e9b621d5c7d5e30c30 + } +} diff --git a/src/main/java/net/minecraft/ChatFormatting.java b/src/main/java/net/minecraft/ChatFormatting.java -index b82b218be1bd849fa280ea1fe0336e279bebfc18..77e35e18754bd2380e1d5f93c62e1d47d21a0a18 100644 +index b82b218be1bd849fa280ea1fe0336e279bebfc18..2fb444653118816f1250841cb4c6c486e67c642b 100644 --- a/src/main/java/net/minecraft/ChatFormatting.java +++ b/src/main/java/net/minecraft/ChatFormatting.java -@@ -86,6 +86,7 @@ public enum ChatFormatting { - return !this.isFormat && this != RESET; - } - -+ @Nullable public Integer getHexValue() { return this.getColor(); } // Paper - OBFHELPER - @Nullable - public Integer getColor() { - return this.color; -@@ -110,6 +111,18 @@ public enum ChatFormatting { +@@ -110,6 +110,18 @@ public enum ChatFormatting { return name == null ? null : FORMATTING_BY_NAME.get(cleanName(name)); } + // Paper start + @Nullable public static ChatFormatting getByHexValue(int i) { + for (ChatFormatting value : values()) { -+ if (value.getHexValue() != null && value.getHexValue() == i) { ++ if (value.getColor() != null && value.getColor() == i) { + return value; + } + } @@ -973,18 +965,6 @@ index b82b218be1bd849fa280ea1fe0336e279bebfc18..77e35e18754bd2380e1d5f93c62e1d47 @Nullable public static ChatFormatting getById(int colorIndex) { if (colorIndex < 0) { -diff --git a/src/main/java/net/minecraft/nbt/StringTag.java b/src/main/java/net/minecraft/nbt/StringTag.java -index ad1c1fbb15cbd744afe54e1c3b533e51021a89eb..b15cfb9374402d4b42d163bf8e3ec838f19004bc 100644 ---- a/src/main/java/net/minecraft/nbt/StringTag.java -+++ b/src/main/java/net/minecraft/nbt/StringTag.java -@@ -43,6 +43,7 @@ public class StringTag implements Tag { - this.data = value; - } - -+ public static StringTag create(final String value) { return valueOf(value); } // Paper - OBFHELPER - public static StringTag valueOf(String value) { - return value.isEmpty() ? EMPTY : new StringTag(value); - } diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java index 3b8207046d38d3d14719ff6761a22e60a93628b7..c15860c77c7c24b1946c22f140f1b5c12b052ade 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java @@ -1043,7 +1023,7 @@ index 83e99af925c87433b59f9bed30dfbf4e490c1b84..b8a0c0411fd2caab21672de7f3e72164 try { int i = friendlyByteBuf.writerIndex(); diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java -index d9aac575213f3bda9c44ea2b3b6d1969ff82f09d..02d19fa4abdee0c8331734932a83e64694356030 100644 +index d9aac575213f3bda9c44ea2b3b6d1969ff82f09d..5ba1636bbb938373e43c1f3ac561368fc9cffd43 100644 --- a/src/main/java/net/minecraft/network/chat/Component.java +++ b/src/main/java/net/minecraft/network/chat/Component.java @@ -1,6 +1,7 @@ @@ -1070,22 +1050,6 @@ index d9aac575213f3bda9c44ea2b3b6d1969ff82f09d..02d19fa4abdee0c8331734932a83e646 JsonObject jsonobject = new JsonObject(); if (!ichatbasecomponent.getStyle().isEmpty()) { -@@ -416,6 +419,7 @@ public interface Component extends Message, FormattedText, Iterable { - }); - } - -+ public static String componentToJson(final Component component) { return toJson(component); } // Paper - OBFHELPER - public static String toJson(Component text) { - return Component.Serializer.GSON.toJson(text); - } -@@ -429,6 +433,7 @@ public interface Component extends Message, FormattedText, Iterable { - return (MutableComponent) GsonHelper.fromJson(Component.Serializer.GSON, json, MutableComponent.class, false); - } - -+ public static @Nullable Component fromJsonTree(final JsonElement json) { return fromJson(json); } // Paper - OBFHELPER - @Nullable - public static MutableComponent fromJson(JsonElement json) { - return (MutableComponent) Component.Serializer.GSON.fromJson(json, MutableComponent.class); diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java index d63a712126973fd1bea547d30c7d116c622669ee..1f5050e6c1d932aa196ab9524f7f1f9bd1b45fce 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundChatPacket.java @@ -1212,7 +1176,7 @@ index 762a9392ffac3042356709dddd15bb3516048bed..3544e2dc2522e9d6305d727d56e73490 buf.writeComponent(this.footer); } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 99292d239dfdd2c0aaeece2b526db011b17aa121..a8fae13b18c1619f898e818b749c02c647f164c5 100644 +index 2b0d989119c9f69a68a6c1c69fb09dbbedd16716..172536147305f283bd14d356ff4f39531e8f3ad9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -145,6 +145,7 @@ import net.minecraft.world.scores.Score; @@ -1410,7 +1374,7 @@ index 78ef2e0d9a32d38c7193859f8ee726c70c9b289e..3e89612f4bf74179b3461166b17b42af } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 89d3a7ab019e735c5057568aa2971018f1a05324..11c0da9b36aecc1a7d3acb2dccdae962426dd2e7 100644 +index 3d1f20a5caf8b4665ea0208af755911c34081323..0df683b7503d4c34fc8af33b82a4440383702043 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -36,6 +36,7 @@ import net.minecraft.world.entity.player.Player; @@ -1601,18 +1565,6 @@ index d289e8321a62f7c8d1e5b83f038e7331a26fc24e..658aff27155b32a0323f55152c7315fd public BossEvent(UUID uuid, Component name, BossEvent.BossBarColor color, BossEvent.BossBarOverlay style) { this.id = uuid; -diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index d5b8931243e2f9cac9b0f92ab8df043a831bbe70..ac05b201167d8e17f39d3df732adf676dc24b409 100644 ---- a/src/main/java/net/minecraft/world/item/ItemStack.java -+++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -1152,6 +1152,7 @@ public final class ItemStack { - } - // CraftBukkit end - -+ public Component displayName() { return this.getDisplayName(); } // Paper - OBFHELPER - public Component getDisplayName() { - MutableComponent ichatmutablecomponent = (new TextComponent("")).append(this.getHoverName()); - diff --git a/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java b/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java index 5a662dd8a05be01cbb232c3dee65d660c9b19a98..07a83fc6f9a83889a0a3b8c714be68302e700a0f 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/Enchantment.java @@ -2558,7 +2510,7 @@ index 6a64fbb8b4937f39d5fdc2e2cbec26c83c74c486..7d6b5fdb00a5c1614849735634262a36 public String getTitle() { return CraftChatMessage.fromComponent(this.container.getTitle()); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 27bbec5f779e7193818e546dbf02a761ff950719..921d838afc5b7ae47a9ee81b7ae4450543a32d98 100644 +index 27bbec5f779e7193818e546dbf02a761ff950719..8f05c6832fc968666f0e6e0a19f6dd74d92d0c28 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -337,4 +337,17 @@ public final class CraftItemFactory implements ItemFactory { @@ -2575,7 +2527,7 @@ index 27bbec5f779e7193818e546dbf02a761ff950719..921d838afc5b7ae47a9ee81b7ae44505 + + @Override + public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) { -+ return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).displayName()); ++ return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName()); + } + // Paper end } @@ -3076,7 +3028,7 @@ index 589cb3bebb4bb193477cc5064c66830eec3e9138..68aa66c340b7a686a353e2a15084d811 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java -index 81f16dc1ed6e102af298600db75cab21a09bc00f..c2dc4d65170eba2d914cf2efdcc231254fec7c02 100644 +index 81f16dc1ed6e102af298600db75cab21a09bc00f..f86776aa42bd5520f8aaeaa46bb93ec4d5b4e27d 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftTeam.java @@ -28,6 +28,55 @@ final class CraftTeam extends CraftScoreboardComponent implements Team { @@ -3120,8 +3072,8 @@ index 81f16dc1ed6e102af298600db75cab21a09bc00f..c2dc4d65170eba2d914cf2efdcc23125 + @Override + public net.kyori.adventure.text.format.TextColor color() throws IllegalStateException { + CraftScoreboard scoreboard = checkState(); -+ if (team.getColor().getHexValue() == null) throw new IllegalStateException("Team colors must have hex values"); -+ net.kyori.adventure.text.format.TextColor color = net.kyori.adventure.text.format.TextColor.color(team.getColor().getHexValue()); ++ if (team.getColor().getColor() == null) throw new IllegalStateException("Team colors must have hex values"); ++ net.kyori.adventure.text.format.TextColor color = net.kyori.adventure.text.format.TextColor.color(team.getColor().getColor()); + if (!(color instanceof net.kyori.adventure.text.format.NamedTextColor)) throw new IllegalStateException("Team doesn't have a NamedTextColor"); + return (net.kyori.adventure.text.format.NamedTextColor) color; + } diff --git a/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index ea21f6702a..1bec0b608a 100644 --- a/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/patches/server/0014-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -19,7 +19,7 @@ index 78948c42b13194005bdbbbc69c2b7ae0732a78c5..b41e7922dd96c3358eb849ab39982a75 + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2bfafeec6f8a605a7826091314992e61a49e4c51..6d7f2db63d586b96939cfc3643ebae3a952a4836 100644 +index e48fe017704b495712b565feff54e1b4ed2d595d..e6abf635281c895505f3201d7329d51f36e24eef 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1264,6 +1264,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -31,7 +31,7 @@ index 2bfafeec6f8a605a7826091314992e61a49e4c51..6d7f2db63d586b96939cfc3643ebae3a return this.isInWater() || this.isInRain() || this.isInBubbleColumn(); } diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index e4f3dbff2605243039f9f59f025c931b3fb309c5..3a444371e484defa3119d04b9fa7cf50ca5966ec 100644 +index e91932d25e7b5d4a95e485bfa8b70632e0641b0a..9f368f32aa93fe5f94b19a884f44ded3bf69a225 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -103,6 +103,7 @@ public abstract class Mob extends LivingEntity { @@ -50,7 +50,7 @@ index e4f3dbff2605243039f9f59f025c931b3fb309c5..3a444371e484defa3119d04b9fa7cf50 + if (!this.aware) { // Paper start - Allow nerfed mobs to jump, float and take water damage + if (goalFloat != null) { + if (goalFloat.validConditions()) goalFloat.update(); -+ this.getJumpControl().jumpIfSet(); ++ this.getJumpControl().tick(); + } + if ((this instanceof net.minecraft.world.entity.monster.Blaze || this instanceof net.minecraft.world.entity.monster.EnderMan) && isInWaterRainOrBubble()) { + hurt(DamageSource.DROWN, 1.0F); @@ -61,18 +61,6 @@ index e4f3dbff2605243039f9f59f025c931b3fb309c5..3a444371e484defa3119d04b9fa7cf50 this.level.getProfiler().push("sensing"); this.sensing.tick(); this.level.getProfiler().pop(); -diff --git a/src/main/java/net/minecraft/world/entity/ai/control/JumpControl.java b/src/main/java/net/minecraft/world/entity/ai/control/JumpControl.java -index 4b85418a53018ce9a70fddde2ab18d52d2fc97d1..83c68b492d4596583160e3c6d56080a11777719c 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/control/JumpControl.java -+++ b/src/main/java/net/minecraft/world/entity/ai/control/JumpControl.java -@@ -14,6 +14,7 @@ public class JumpControl implements Control { - this.jump = true; - } - -+ public final void jumpIfSet() { this.tick(); } // Paper - OBFHELPER - public void tick() { - this.mob.setJumping(this.jump); - this.jump = false; diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java index 54085b104547f2fe7c08ff8aa4839b1230877bca..5a2e3cc833b3fa7d6fcea1474e25c469a53b3bae 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java diff --git a/patches/server/0048-Player-Tab-List-and-Title-APIs.patch b/patches/server/0048-Player-Tab-List-and-Title-APIs.patch index 6a5fae51d3..9486bc28a9 100644 --- a/patches/server/0048-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0048-Player-Tab-List-and-Title-APIs.patch @@ -20,18 +20,6 @@ index c15860c77c7c24b1946c22f140f1b5c12b052ade..c0966a873ea5e265936e17796bf6bbee // Paper end public FriendlyByteBuf writeComponent(Component text) { -diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java -index 02d19fa4abdee0c8331734932a83e64694356030..969aea457e76b853e34a67a8fd07e0ea3207005b 100644 ---- a/src/main/java/net/minecraft/network/chat/Component.java -+++ b/src/main/java/net/minecraft/network/chat/Component.java -@@ -428,6 +428,7 @@ public interface Component extends Message, FormattedText, Iterable { - return Component.Serializer.GSON.toJsonTree(text); - } - -+ @Nullable public static Component jsonToComponent(String json) { return fromJson(json);} // Paper - OBFHELPER - @Nullable - public static MutableComponent fromJson(String json) { - return (MutableComponent) GsonHelper.fromJson(Component.Serializer.GSON, json, MutableComponent.class, false); diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java index c44a276d201fdfa5144d45d319d7761583c60639..f68a1a6dc6add9496e25cb52c318e086e356e2bb 100644 --- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket.java diff --git a/patches/server/0150-Implement-ensureServerConversions-API.patch b/patches/server/0150-Implement-ensureServerConversions-API.patch index 72f70ceb8c..cd38c5b10e 100644 --- a/patches/server/0150-Implement-ensureServerConversions-API.patch +++ b/patches/server/0150-Implement-ensureServerConversions-API.patch @@ -7,12 +7,12 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 921d838afc5b7ae47a9ee81b7ae4450543a32d98..0bf6c27fdcc2a4342c68441670244cabf40f8e7e 100644 +index 8f05c6832fc968666f0e6e0a19f6dd74d92d0c28..69852a3801439db075e522aa2e2dc51e84c3deda 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -349,5 +349,11 @@ public final class CraftItemFactory implements ItemFactory { public net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component displayName(@org.jetbrains.annotations.NotNull ItemStack itemStack) { - return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).displayName()); + return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName()); } + + // Paper start diff --git a/patches/server/0151-Implement-getI18NDisplayName.patch b/patches/server/0151-Implement-getI18NDisplayName.patch index a8882d517d..0209464179 100644 --- a/patches/server/0151-Implement-getI18NDisplayName.patch +++ b/patches/server/0151-Implement-getI18NDisplayName.patch @@ -7,20 +7,8 @@ Gets the Display name as seen in the Client. Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. -diff --git a/src/main/java/net/minecraft/locale/Language.java b/src/main/java/net/minecraft/locale/Language.java -index f06452538f45e2430611aad54d060e040b32bb58..67f5448d0a03c1e018f71bdb76610a85867cc0b8 100644 ---- a/src/main/java/net/minecraft/locale/Language.java -+++ b/src/main/java/net/minecraft/locale/Language.java -@@ -107,6 +107,7 @@ public abstract class Language { - instance = language; - } - -+ @Deprecated public String translateKey(String key) { return getOrDefault(key); } // Paper - OBFHELPER - public abstract String getOrDefault(String key); - - public abstract boolean has(String key); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 0bf6c27fdcc2a4342c68441670244cabf40f8e7e..6ec39de514ceed7e5ffe9a8dc94c2ffd2902cd98 100644 +index 69852a3801439db075e522aa2e2dc51e84c3deda..001e89e85fb935c539c53c8e9c78927e26e099d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -355,5 +355,18 @@ public final class CraftItemFactory implements ItemFactory { diff --git a/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch b/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch index 2500d0813a..61e0a0c89d 100644 --- a/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch +++ b/patches/server/0248-Use-ConcurrentHashMap-in-JsonList.patch @@ -38,7 +38,7 @@ index 7c5a75fb34640bb4e7ef839412dbb30b0d0fc8e8..b62aa9f934c33b4d22b985b5e56937ba chatmessage = new TranslatableComponent("multiplayer.disconnect.banned_ip.reason", new Object[]{ipbanentry.getReason()}); diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java -index 00e3662e25618459447d4ce5f56f7e046bfe47e2..4b85943a704e0a5ca6b95f9cfcbfd1f9505c3b68 100644 +index 00e3662e25618459447d4ce5f56f7e046bfe47e2..0851dca56ae680387d56b3fdc894746c248604f5 100644 --- a/src/main/java/net/minecraft/server/players/StoredUserList.java +++ b/src/main/java/net/minecraft/server/players/StoredUserList.java @@ -12,6 +12,8 @@ import java.io.BufferedReader; @@ -83,14 +83,14 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..4b85943a704e0a5ca6b95f9cfcbfd1f9 + // Paper start + // this.g(); + // return (V) this.d.get(this.a(k0)); // CraftBukkit - fix decompile error -+ return (V) this.getBackingMap().computeIfPresent(this.getMappingKey(key), (k, v) -> { ++ return (V) this.getBackingMap().computeIfPresent(this.getKeyForUser(key), (k, v) -> { + return v.hasExpired() ? null : v; + }); + // Paper end } public void remove(K key) { -@@ -83,9 +105,11 @@ public abstract class StoredUserList> { +@@ -83,7 +105,8 @@ public abstract class StoredUserList> { // CraftBukkit end public boolean isEmpty() { @@ -99,15 +99,10 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..4b85943a704e0a5ca6b95f9cfcbfd1f9 + return this.getBackingMap().isEmpty(); // Paper - readability is the goal. As an aside, isEmpty() uses only sumCount() and a comparison. size() uses sumCount(), casts, and boolean logic } -+ protected final String getMappingKey(K k0) { return getKeyForUser(k0); } // Paper - OBFHELPER protected String getKeyForUser(K profile) { - return profile.toString(); - } -@@ -94,15 +118,16 @@ public abstract class StoredUserList> { - return this.map.containsKey(this.getKeyForUser(k0)); +@@ -95,14 +118,14 @@ public abstract class StoredUserList> { } -+ private void removeStaleEntries() { removeExpired(); } // Paper - OBFHELPER private void removeExpired() { - List list = Lists.newArrayList(); - Iterator iterator = this.map.values().iterator(); @@ -123,7 +118,7 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..4b85943a704e0a5ca6b95f9cfcbfd1f9 } } -@@ -111,9 +136,11 @@ public abstract class StoredUserList> { +@@ -111,9 +134,11 @@ public abstract class StoredUserList> { while (iterator.hasNext()) { K k0 = (K) iterator.next(); // CraftBukkit - decompile error @@ -137,11 +132,11 @@ index 00e3662e25618459447d4ce5f56f7e046bfe47e2..4b85943a704e0a5ca6b95f9cfcbfd1f9 } protected abstract StoredUserEntry createEntry(JsonObject json); -@@ -123,6 +150,7 @@ public abstract class StoredUserList> { +@@ -123,6 +148,7 @@ public abstract class StoredUserList> { } public void save() throws IOException { -+ this.removeStaleEntries(); // Paper - remove expired values before saving ++ this.removeExpired(); // Paper - remove expired values before saving JsonArray jsonarray = new JsonArray(); Stream stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error JsonObject jsonobject = new JsonObject(); diff --git a/patches/server/0272-Catch-JsonParseException-in-Entity-and-TE-names.patch b/patches/server/0272-Catch-JsonParseException-in-Entity-and-TE-names.patch index 0493d912d5..3704aee1b2 100644 --- a/patches/server/0272-Catch-JsonParseException-in-Entity-and-TE-names.patch +++ b/patches/server/0272-Catch-JsonParseException-in-Entity-and-TE-names.patch @@ -13,7 +13,7 @@ Shulkers) may need to be changed in order for it to re-save properly No more crashing though. diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 5c290f263fc2b643987c96ea75729bf1ff493760..0df3961919f04f27eb265ab316aa5a0f15a70854 100644 +index 5c290f263fc2b643987c96ea75729bf1ff493760..2d0c10c72a9ddc5a26352fad6baae2f6c2678923 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -6,6 +6,8 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; @@ -36,7 +36,7 @@ index 5c290f263fc2b643987c96ea75729bf1ff493760..0df3961919f04f27eb265ab316aa5a0f + } + String string = compound.getString(key); + try { -+ return Component.Serializer.jsonToComponent(string); ++ return Component.Serializer.fromJson(string); + } catch (com.google.gson.JsonParseException e) { + org.bukkit.Bukkit.getLogger().warning("Unable to parse " + key + " from " + compound +": " + e.getMessage()); + } diff --git a/patches/server/0284-Here-s-Johnny.patch b/patches/server/0284-Here-s-Johnny.patch index 4f0deb6247..fb2a745aa8 100644 --- a/patches/server/0284-Here-s-Johnny.patch +++ b/patches/server/0284-Here-s-Johnny.patch @@ -4,21 +4,8 @@ Date: Fri, 12 Oct 2018 01:37:22 -0500 Subject: [PATCH] Here's Johnny! -diff --git a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -index 6203069a09c578200b8de5e18e351f700472b62c..e3f900153c10a01fd8b1ba346fe87880c958b76a 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -+++ b/src/main/java/net/minecraft/world/entity/monster/Vindicator.java -@@ -51,7 +51,7 @@ public class Vindicator extends AbstractIllager { - public static final Predicate DOOR_BREAKING_PREDICATE = (difficulty) -> { - return difficulty == Difficulty.NORMAL || difficulty == Difficulty.HARD; - }; -- boolean isJohnny; -+ private boolean isJohnny; public boolean isJohnny() { return this.isJohnny; } public void setJohnny(boolean johnny) { this.isJohnny = johnny; } // Paper - OBFHELPER - - public Vindicator(EntityType type, Level world) { - super(type, world); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -index 3c5994e9862e5caa257ee6a21f8fba2df39c98c5..6c1569340317f7bed39eaf6e858d602234993eb3 100644 +index 3c5994e9862e5caa257ee6a21f8fba2df39c98c5..50a318d7a6cec1e137c913f1d04a7e9606ba2ec2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java @@ -24,4 +24,14 @@ public class CraftVindicator extends CraftIllager implements Vindicator { @@ -28,11 +15,11 @@ index 3c5994e9862e5caa257ee6a21f8fba2df39c98c5..6c1569340317f7bed39eaf6e858d6022 + + // Paper start + public boolean isJohnny() { -+ return getHandle().isJohnny(); ++ return getHandle().isJohnny; + } + + public void setJohnny(boolean johnny) { -+ getHandle().setJohnny(johnny); ++ getHandle().isJohnny = johnny; + } + // Paper end } diff --git a/patches/server/0286-Reset-players-airTicks-on-respawn.patch b/patches/server/0286-Reset-players-airTicks-on-respawn.patch index b5fd6a3600..fc737cc629 100644 --- a/patches/server/0286-Reset-players-airTicks-on-respawn.patch +++ b/patches/server/0286-Reset-players-airTicks-on-respawn.patch @@ -5,26 +5,14 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 3ca3a1c16ea0900bfb868a6e2fc88e3522bf7752..8beca0412c65ad03376fb76e2d993bc841bf9e0b 100644 +index 3ca3a1c16ea0900bfb868a6e2fc88e3522bf7752..f389e2974bb2a8f44171d1f21a88c4fd6d76527f 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -2210,6 +2210,7 @@ public class ServerPlayer extends Player { } this.setHealth(this.getMaxHealth()); -+ this.setAirSupply(this.getMaxAirTicks()); // Paper ++ this.setAirSupply(this.getMaxAirSupply()); // Paper this.remainingFireTicks = 0; this.fallDistance = 0; this.foodData = new FoodData(this); -diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7ba9193b3203ebc8c71e605bd80717bb16790565..1f00d9dfb6949010a146a4536e80ae4feaa07b25 100644 ---- a/src/main/java/net/minecraft/world/entity/Entity.java -+++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2608,6 +2608,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n - - } - -+ public final int getMaxAirTicks() { return getMaxAirSupply(); } // Paper - OBFHELPER - public int getMaxAirSupply() { - return 300; - } diff --git a/patches/server/0334-Chunk-debug-command.patch b/patches/server/0334-Chunk-debug-command.patch index b3eca55d69..4f0b12b3b8 100644 --- a/patches/server/0334-Chunk-debug-command.patch +++ b/patches/server/0334-Chunk-debug-command.patch @@ -212,7 +212,7 @@ index 1fa190e098079522e0fe3593fa261c1b7ad4e24b..71ffa66973d8994e2a480435ac1ada3f * Ported from MinecraftForge - author: LexManos - License: LGPLv2.1 */ diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 0df3961919f04f27eb265ab316aa5a0f15a70854..bb0a07a280c7d4885165e9d6488e7741aaa7b47c 100644 +index 2d0c10c72a9ddc5a26352fad6baae2f6c2678923..dcc8837d0c806a3755f1d20b6780b674edf09a11 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -8,13 +8,27 @@ import net.minecraft.core.BlockPos; @@ -260,7 +260,7 @@ index 0df3961919f04f27eb265ab316aa5a0f15a70854..bb0a07a280c7d4885165e9d6488e7741 } + public static ChunkStatus getChunkStatus(ChunkHolder chunk) { -+ List statuses = ServerChunkCache.getPossibleChunkStatuses(); ++ List statuses = net.minecraft.server.level.ServerChunkCache.CHUNK_STATUSES; + for (int i = statuses.size() - 1; i >= 0; --i) { + ChunkStatus curr = statuses.get(i); + CompletableFuture> future = chunk.getFutureIfPresentUnchecked(curr); @@ -394,8 +394,8 @@ index 0df3961919f04f27eb265ab316aa5a0f15a70854..bb0a07a280c7d4885165e9d6488e7741 + + ticketData.addProperty("ticket-type", ticket.getType().toString()); + ticketData.addProperty("ticket-level", ticket.getTicketLevel()); -+ ticketData.addProperty("object-reason", String.valueOf(ticket.getObjectReason())); -+ ticketData.addProperty("add-tick", ticket.getCreationTick()); ++ ticketData.addProperty("object-reason", String.valueOf(ticket.key)); ++ ticketData.addProperty("add-tick", ticket.createdTick); + + ticketsData.add(ticketData); + } @@ -428,44 +428,3 @@ index 0df3961919f04f27eb265ab316aa5a0f15a70854..bb0a07a280c7d4885165e9d6488e7741 public static int getTicketLevelFor(net.minecraft.world.level.chunk.ChunkStatus status) { return net.minecraft.server.level.ChunkMap.MAX_VIEW_DISTANCE + net.minecraft.world.level.chunk.ChunkStatus.getDistance(status); } -diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index 1ff399ae84eb5281cd058556f67374688ab59e54..1e52b8e97dcee512e7d2fbe157152df9e0779bf1 100644 ---- a/src/main/java/net/minecraft/server/level/ChunkHolder.java -+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java -@@ -61,7 +61,7 @@ public class ChunkHolder { - public int oldTicketLevel; - private int ticketLevel; - private int queueLevel; -- final ChunkPos pos; -+ public final ChunkPos pos; // Paper - package->public - private boolean hasChangedSections; - private final ShortSet[] changedBlocksPerSection; - private final BitSet blockChangedLightSectionFilter; -diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index b15d5c2a8d4d2184a55a16ff2071fd82cb2e0457..d76568b06ff5035e59b664e371fe4a216517327a 100644 ---- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java -+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -49,7 +49,7 @@ import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper - - public class ServerChunkCache extends ChunkSource { - -- private static final List CHUNK_STATUSES = ChunkStatus.getStatusList(); -+ private static final List CHUNK_STATUSES = ChunkStatus.getStatusList(); public static final List getPossibleChunkStatuses() { return ServerChunkCache.CHUNK_STATUSES; } // Paper - OBFHELPER - private final DistanceManager distanceManager; - public final ChunkGenerator generator; - final ServerLevel level; -diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java -index b346fa94b23d81da7da073f71dd12e672e0f079c..8b0c6e1a649400908dbb674dfb4cdd1aa0ce1d38 100644 ---- a/src/main/java/net/minecraft/server/level/Ticket.java -+++ b/src/main/java/net/minecraft/server/level/Ticket.java -@@ -5,8 +5,8 @@ import java.util.Objects; - public final class Ticket implements Comparable> { - private final TicketType type; - private final int ticketLevel; -- public final T key; -- private long createdTick; -+ public final T key; public final T getObjectReason() { return this.key; } // Paper - OBFHELPER -+ private long createdTick; public final long getCreationTick() { return this.createdTick; } // Paper - OBFHELPER - - protected Ticket(TicketType type, int level, T argument) { - this.type = type; diff --git a/patches/server/0368-Anti-Xray.patch b/patches/server/0368-Anti-Xray.patch index c38b23d29d..ea6deed12a 100644 --- a/patches/server/0368-Anti-Xray.patch +++ b/patches/server/0368-Anti-Xray.patch @@ -1305,7 +1305,7 @@ index 5fd66020a937b641e2a060cf38df731a43f3bf55..ec8b67c1b024df38d5e1ad81acff3353 public int getSerializedSize() { diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 5ea60bbb56450502f1ceb41959239ab579458ac2..b5b0dbbb21f15a61017d8fc936feed30c2b193dc 100644 +index 5ea60bbb56450502f1ceb41959239ab579458ac2..66175691af9417275dee33bbc07c6826e807d571 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java +++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java @@ -28,6 +28,7 @@ public class PalettedContainer implements PaletteResize { @@ -1398,7 +1398,7 @@ index 5ea60bbb56450502f1ceb41959239ab579458ac2..b5b0dbbb21f15a61017d8fc936feed30 + int section = (bottomBlockY >> 4) - chunkPacketInfo.getChunk().getMinSection(); + chunkPacketInfo.setBitsPerObject(section, this.bits); + chunkPacketInfo.setDataPalette(section, this.palette); -+ chunkPacketInfo.setDataBitsIndex(section, buf.writerIndex() + FriendlyByteBuf.getVarIntSize(this.storage.getDataBits().length)); ++ chunkPacketInfo.setDataBitsIndex(section, buf.writerIndex() + FriendlyByteBuf.getVarIntSize(this.storage.getRaw().length)); + chunkPacketInfo.setPredefinedObjects(section, this.predefinedObjects); + } + // Paper end diff --git a/patches/server/0372-Fix-items-vanishing-through-end-portal.patch b/patches/server/0372-Fix-items-vanishing-through-end-portal.patch index 3c47bebf34..cac7fe143c 100644 --- a/patches/server/0372-Fix-items-vanishing-through-end-portal.patch +++ b/patches/server/0372-Fix-items-vanishing-through-end-portal.patch @@ -13,10 +13,10 @@ Quickly loading the exact world spawn chunk before searching the heightmap resolves the issue without having to load all spawn chunks. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 4185041c576349adc14d20926d0f7ddd00145c53..9f3447ba69fcbfb60b778b60851a0caf4cd3ddf9 100644 +index 93f2db7b9c601654d7cae199369774def4b3adca..8212e868e482d7b7495eac001bfa1c5ee3c752f1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3005,6 +3005,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -3004,6 +3004,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n BlockPos blockposition1; if (flag1) { diff --git a/patches/server/0425-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/0425-Fix-numerous-item-duplication-issues-and-teleport-is.patch index 0c5142cd5d..fc2375e144 100644 --- a/patches/server/0425-Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/patches/server/0425-Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -16,7 +16,7 @@ So even if something NEW comes up, it would be impossible to drop the same item twice because the source was destroyed. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 16257d3d0e822d562e1a309fc6ab109dbdd7c13e..58b5d3442ac90e15bd35e4d423af44b88ca257dc 100644 +index de7e841ef7e9589ab49c7df040c59387b76f12af..5bdb1ce8875c276e5f7997db83b097b910c0a136 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -2147,11 +2147,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -34,7 +34,7 @@ index 16257d3d0e822d562e1a309fc6ab109dbdd7c13e..58b5d3442ac90e15bd35e4d423af44b8 entityitem.setDefaultPickUpDelay(); // CraftBukkit start -@@ -2895,6 +2896,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -2894,6 +2895,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @Nullable public Entity teleportTo(ServerLevel worldserver, BlockPos location) { // CraftBukkit end @@ -47,7 +47,7 @@ index 16257d3d0e822d562e1a309fc6ab109dbdd7c13e..58b5d3442ac90e15bd35e4d423af44b8 if (this.level instanceof ServerLevel && !this.isRemoved()) { this.level.getProfiler().push("changeDimension"); // CraftBukkit start -@@ -2915,6 +2922,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -2914,6 +2921,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n // CraftBukkit end this.level.getProfiler().popPush("reloading"); @@ -59,7 +59,7 @@ index 16257d3d0e822d562e1a309fc6ab109dbdd7c13e..58b5d3442ac90e15bd35e4d423af44b8 Entity entity = this.getType().create((Level) worldserver); if (entity != null) { -@@ -2928,10 +2940,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -2927,10 +2939,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n // CraftBukkit start - Forward the CraftEntity to the new entity this.getBukkitEntity().setHandle(entity); entity.bukkitEntity = this.getBukkitEntity(); @@ -70,7 +70,7 @@ index 16257d3d0e822d562e1a309fc6ab109dbdd7c13e..58b5d3442ac90e15bd35e4d423af44b8 // CraftBukkit end } -@@ -3056,7 +3064,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -3055,7 +3063,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n } public boolean canChangeDimensions() { diff --git a/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch index 671c7766fd..5520dd32b5 100644 --- a/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/0433-Use-distance-map-to-optimise-entity-tracker.patch @@ -18,7 +18,7 @@ index 11fd6d24ed0612e4df1a0493907178fb9c455d1c..d7023cb0974f6c28a0fb8a0a6e5a6600 return initialDistance; } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 187a4542dbdad2708a6ada8a84591788d5d1a125..a345d4bff47b937852ad33be42d5c823dc11c733 100644 +index 187a4542dbdad2708a6ada8a84591788d5d1a125..57467cf2425bc9278e45c7ea5194a29155c69b92 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -63,6 +63,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket; @@ -185,7 +185,7 @@ index 187a4542dbdad2708a6ada8a84591788d5d1a125..a345d4bff47b937852ad33be42d5c823 + this.level.timings.tracker2.startTiming(); + try { + for (TrackedEntity tracker : this.entityMap.values()) { -+ tracker.serverEntity.tick(); ++ tracker.serverEntity.sendChanges(); + } + } finally { + this.level.timings.tracker2.stopTiming(); @@ -299,20 +299,8 @@ index 187a4542dbdad2708a6ada8a84591788d5d1a125..a345d4bff47b937852ad33be42d5c823 i = j; } } -diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 28afe2f238ded241acf77c3272a44068646b9133..6b492b72b177e3c58580561585609b176876acf1 100644 ---- a/src/main/java/net/minecraft/server/level/ServerEntity.java -+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -87,6 +87,7 @@ public class ServerEntity { - this.wasOnGround = entity.isOnGround(); - } - -+ public final void tick() { this.sendChanges(); } // Paper - OBFHELPER - public void sendChanges() { - List list = this.entity.getPassengers(); - diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 58b5d3442ac90e15bd35e4d423af44b88ca257dc..1afb2cf4fd5938346ab035fab2af960049b5d7d3 100644 +index 5bdb1ce8875c276e5f7997db83b097b910c0a136..2cf6c22de0416fad843a901d2ffb97a55937290f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -50,6 +50,7 @@ import net.minecraft.network.syncher.EntityDataSerializers; diff --git a/patches/server/0445-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/patches/server/0445-Reduce-allocation-of-Vec3D-by-entity-tracker.patch index 3580bc0bfd..94de127ddc 100644 --- a/patches/server/0445-Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/patches/server/0445-Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index b4b330988bf1a2f0b2ec7da35ee816c1d60f3ab9..07a5f69ab2527b038dc4c404dd621a262cad3931 100644 +index 08fa9b753e87bf982f9eac40b89951643f0f9904..39c7ffe656b6e1217d1e7bcf45f68501ed7e015d 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -2142,9 +2142,14 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially @@ -26,10 +26,10 @@ index b4b330988bf1a2f0b2ec7da35ee816c1d60f3ab9..07a5f69ab2527b038dc4c404dd621a26 // CraftBukkit start - respect vanish API if (this.entity instanceof ServerPlayer) { diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java -index 6b492b72b177e3c58580561585609b176876acf1..8ea4209400489116823eced292d8cd9654a1c809 100644 +index 28afe2f238ded241acf77c3272a44068646b9133..44aa0c4ec6f0e4df2541c74fa7de852dae59bda5 100644 --- a/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java -@@ -145,8 +145,12 @@ public class ServerEntity { +@@ -144,8 +144,12 @@ public class ServerEntity { ++this.teleportDelay; i = Mth.floor(this.entity.getYRot() * 256.0F / 360.0F); j = Mth.floor(this.entity.getXRot() * 256.0F / 360.0F); @@ -44,7 +44,7 @@ index 6b492b72b177e3c58580561585609b176876acf1..8ea4209400489116823eced292d8cd96 Packet packet1 = null; boolean flag2 = flag1 || this.tickCount % 60 == 0; boolean flag3 = Math.abs(i - this.yRotp) >= 1 || Math.abs(j - this.xRotp) >= 1; -@@ -163,9 +167,11 @@ public class ServerEntity { +@@ -162,9 +166,11 @@ public class ServerEntity { // CraftBukkit end if (this.tickCount > 0 || this.entity instanceof AbstractArrow) { diff --git a/patches/server/0453-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/patches/server/0453-Delay-Chunk-Unloads-based-on-Player-Movement.patch index 43cf042cd8..8f35a6e0f8 100644 --- a/patches/server/0453-Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/patches/server/0453-Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -69,13 +69,13 @@ index 577b391dcba1db712c1e2c83296e1c87b3e34ab2..d94241bcca4f2fd5e464a860bd356af5 if (arraysetsorted.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java -index 8b0c6e1a649400908dbb674dfb4cdd1aa0ce1d38..a7aa7a9038d4812a9d1e4e72c4dbbbe10df15820 100644 +index ffc43e5d3d0563c9e9c171064511b2c65ddf67e1..f1128f0d4a9a0241ac6c9bc18dd13b431c616bb1 100644 --- a/src/main/java/net/minecraft/server/level/Ticket.java +++ b/src/main/java/net/minecraft/server/level/Ticket.java @@ -7,11 +7,13 @@ public final class Ticket implements Comparable> { private final int ticketLevel; - public final T key; public final T getObjectReason() { return this.key; } // Paper - OBFHELPER - private long createdTick; public final long getCreationTick() { return this.createdTick; } // Paper - OBFHELPER + public final T key; + public long createdTick; + public long delayUnloadBy; // Paper protected Ticket(TicketType type, int level, T argument) { diff --git a/patches/server/0466-Ensure-Entity-AABB-s-are-never-invalid.patch b/patches/server/0466-Ensure-Entity-AABB-s-are-never-invalid.patch index 40bc833f57..f1988656b9 100644 --- a/patches/server/0466-Ensure-Entity-AABB-s-are-never-invalid.patch +++ b/patches/server/0466-Ensure-Entity-AABB-s-are-never-invalid.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1afb2cf4fd5938346ab035fab2af960049b5d7d3..5db6b853e61e62e40e55034d5738717664cb9245 100644 +index 2cf6c22de0416fad843a901d2ffb97a55937290f..f4465c2352451400591691711281bbf8fdb9974e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -560,7 +560,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -17,7 +17,7 @@ index 1afb2cf4fd5938346ab035fab2af960049b5d7d3..5db6b853e61e62e40e55034d57387176 } protected AABB makeBoundingBox() { -@@ -3738,6 +3738,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -3737,6 +3737,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n } public final void setPosRaw(double x, double y, double z) { diff --git a/patches/server/0467-Optimize-WorldBorder-collision-checks-and-air.patch b/patches/server/0467-Optimize-WorldBorder-collision-checks-and-air.patch index 4fa55c2806..123bf6bbdb 100644 --- a/patches/server/0467-Optimize-WorldBorder-collision-checks-and-air.patch +++ b/patches/server/0467-Optimize-WorldBorder-collision-checks-and-air.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimize WorldBorder collision checks and air diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 5db6b853e61e62e40e55034d5738717664cb9245..4965d6beb0486400f5d28220d6e132e2029cf86e 100644 +index f4465c2352451400591691711281bbf8fdb9974e..5a8ea643e2a79af8b02a9ada6b9d9d159f6b637d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -1044,7 +1044,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n @@ -18,7 +18,7 @@ index 5db6b853e61e62e40e55034d5738717664cb9245..4965d6beb0486400f5d28220d6e132e2 return true; }); diff --git a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java -index 90039d01ef481ba206f2e952c99a755e94201ea3..2e93f33d6c9074c246c2289523b1fda20a2cf0dd 100644 +index 90039d01ef481ba206f2e952c99a755e94201ea3..61a74f2a53e0f3f6fb33fd213f7738e1d68deb11 100644 --- a/src/main/java/net/minecraft/world/level/CollisionSpliterator.java +++ b/src/main/java/net/minecraft/world/level/CollisionSpliterator.java @@ -135,9 +135,10 @@ public class CollisionSpliterator extends AbstractSpliterator { @@ -30,7 +30,7 @@ index 90039d01ef481ba206f2e952c99a755e94201ea3..2e93f33d6c9074c246c2289523b1fda2 - action.accept(voxelShape); + // Paper start + if (worldBorder.isWithinBounds(aABB.deflate(1.0E-7D)) && !worldBorder.isWithinBounds(aABB.inflate(1.0E-7D))) { -+ action.accept(worldBorder.asVoxelShape()); ++ action.accept(worldBorder.getCollisionShape()); + // Paper end return true; } diff --git a/patches/server/0477-Remove-streams-from-classes-related-villager-gossip.patch b/patches/server/0477-Remove-streams-from-classes-related-villager-gossip.patch index 33f04fdb71..ffb1ee3b3c 100644 --- a/patches/server/0477-Remove-streams-from-classes-related-villager-gossip.patch +++ b/patches/server/0477-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 39c0fbae8b94dabd27ee8687015557c6a9279813..5fb4d8f8627d795ca152573d57fc0c8c25105e51 100644 +index 39c0fbae8b94dabd27ee8687015557c6a9279813..9c08a3e93ca56479ccd7a76a9031683182f23e59 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; @@ -65,7 +65,7 @@ index 39c0fbae8b94dabd27ee8687015557c6a9279813..5fb4d8f8627d795ca152573d57fc0c8c + int weight = 0; + for (Object2IntMap.Entry entry : entries.object2IntEntrySet()) { + if (gossipTypeFilter.test(entry.getKey())) { -+ weight += entry.getIntValue() * entry.getKey().getWeight(); ++ weight += entry.getIntValue() * entry.getKey().weight; + } + } + return weight; @@ -81,16 +81,3 @@ index 39c0fbae8b94dabd27ee8687015557c6a9279813..5fb4d8f8627d795ca152573d57fc0c8c } public Stream unpack(UUID target) { -diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipType.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipType.java -index c82b26dd4a16d77b7ed06c2919082edd62a3dffc..ad1b49cfa201fe6e80b3cd0204f8ffaf6115c081 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipType.java -+++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipType.java -@@ -17,7 +17,7 @@ public enum GossipType { - public static final int REPUTATION_CHANGE_PER_EVERLASTING_MEMORY = 20; - public static final int REPUTATION_CHANGE_PER_TRADE = 2; - public final String id; -- public final int weight; -+ public final int weight; public int getWeight() { return weight; } // Paper - OBFHELPER - public final int max; - public final int decayPerDay; - public final int decayPerTransfer; diff --git a/patches/server/0482-Update-itemstack-legacy-name-and-lore.patch b/patches/server/0482-Update-itemstack-legacy-name-and-lore.patch index 47781d395a..629f47345b 100644 --- a/patches/server/0482-Update-itemstack-legacy-name-and-lore.patch +++ b/patches/server/0482-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 d0cf2ab939392b8bf6558a69d5110a8c18c092b8..b2a88d2005795d8d92c3f550d9f8eeb316a45298 100644 +index 2fd3d56768f9121c1e5de3f193258bb360bb103b..b513fa552440da7a722dfe8cbf92e7294495cd67 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -170,6 +170,44 @@ public final class ItemStack { @@ -34,7 +34,7 @@ index d0cf2ab939392b8bf6558a69d5110a8c18c092b8..b2a88d2005795d8d92c3f550d9f8eeb3 + try { + list.set(index, convert(json)); + } catch (JsonParseException e) { -+ list.set(index, net.minecraft.nbt.StringTag.create(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(new TextComponent("")))); ++ list.set(index, net.minecraft.nbt.StringTag.valueOf(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(new TextComponent("")))); + } + } + } @@ -43,12 +43,12 @@ index d0cf2ab939392b8bf6558a69d5110a8c18c092b8..b2a88d2005795d8d92c3f550d9f8eeb3 + } + + private net.minecraft.nbt.StringTag convert(String json) { -+ Component component = Component.Serializer.jsonToComponent(json); ++ Component component = Component.Serializer.fromJson(json); + if (component instanceof TextComponent && component.getContents().contains("\u00A7") && component.getSiblings().isEmpty()) { + // Only convert if the root component is a single comp with legacy in it, don't convert already normal components + component = org.bukkit.craftbukkit.util.CraftChatMessage.fromString(component.getContents())[0]; + } -+ return net.minecraft.nbt.StringTag.create(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(component)); ++ return net.minecraft.nbt.StringTag.valueOf(org.bukkit.craftbukkit.util.CraftChatMessage.toJSON(component)); + } // Paper end diff --git a/patches/server/0487-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/patches/server/0487-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index e379276955..63ab6ce6aa 100644 --- a/patches/server/0487-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/patches/server/0487-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -68,7 +68,7 @@ index 18ae2e2b339d357fbe0f6f2b18bc14c0dfe4c222..3b7ba9c755c82a6f086d5542d32b3567 } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 87c9a5c1b43f6010898d72136b5eb9973299b723..d517ae863e9cba4505d4c698c2edbd1457e877e9 100644 +index 4d82abf234f67af124dff3f726a6a2e39313a780..e2e01012b4a40bb2a63d780c50d7567b173d5e41 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -671,6 +671,7 @@ public final class MCUtil { @@ -80,7 +80,7 @@ index 87c9a5c1b43f6010898d72136b5eb9973299b723..d517ae863e9cba4505d4c698c2edbd14 chunkData.addProperty("queued-for-unload", chunkMap.toDrop.contains(playerChunk.pos.longKey)); chunkData.addProperty("status", status == null ? "unloaded" : status.toString()); diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java -index c2401b2ff0547335ddbbeb05c07b74552c246fc9..377993f325400a9bc77f5fbc77d9ec50f5d76638 100644 +index 948a817a1d6f4435655931357aa094b889771e82..7dbf99df56562238ba02493e7c39995afa4cb923 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java +++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -60,7 +60,7 @@ public class ChunkHolder { @@ -89,7 +89,7 @@ index c2401b2ff0547335ddbbeb05c07b74552c246fc9..377993f325400a9bc77f5fbc77d9ec50 private int ticketLevel; - private int queueLevel; + public volatile int queueLevel; // Paper - private->public, make volatile since this is concurrently accessed - public final ChunkPos pos; // Paper - package->public + public final ChunkPos pos; private boolean hasChangedSections; private final ShortSet[] changedBlocksPerSection; @@ -75,6 +75,7 @@ public class ChunkHolder { @@ -312,7 +312,7 @@ index c2401b2ff0547335ddbbeb05c07b74552c246fc9..377993f325400a9bc77f5fbc77d9ec50 if (chunk != null) { chunkStorage.callbackExecutor.execute(() -> { diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 07a5f69ab2527b038dc4c404dd621a262cad3931..eced6724126f5c967df95c9c1febef9833b9de26 100644 +index 39c7ffe656b6e1217d1e7bcf45f68501ed7e015d..c5340b254c0d4ae2fbffe7253da12b89224d8608 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -148,6 +148,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -941,7 +941,7 @@ index d94241bcca4f2fd5e464a860bd356af504dc68b7..e82dcc43ae03c31e9e3ec31dbcfecfde } } diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index e46ccbca0cfa63dd5143080375193a95a9249d60..80cda453dc9dd8267eff8a6445d5cd63a13a64c3 100644 +index 135d162a926bd258d2aa001b7d0ef880fd3f2fb9..52f1e2c06cccfead14032cd83ed2dadd668d923c 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -446,6 +446,26 @@ public class ServerChunkCache extends ChunkSource { @@ -1027,7 +1027,7 @@ index e46ccbca0cfa63dd5143080375193a95a9249d60..80cda453dc9dd8267eff8a6445d5cd63 boolean flag1 = this.chunkMap.promoteChunkMap(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d59e707f28a5f04545208ad33d122fc433b85933..1dd21dc364eef75667d56db33c5df8e006453a08 100644 +index fa2eb25cdf7d8b0a80b46bc98dcdde7b67e50813..8f12232bfdf82c140fe83f88ef93b96092d586a8 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -183,6 +183,14 @@ public class ServerPlayer extends Player { @@ -1076,12 +1076,12 @@ index d59e707f28a5f04545208ad33d122fc433b85933..1dd21dc364eef75667d56db33c5df8e0 for (int i = 0; i < this.getInventory().getContainerSize(); ++i) { ItemStack itemstack = this.getInventory().getItem(i); diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java -index a7aa7a9038d4812a9d1e4e72c4dbbbe10df15820..df06e9b3e082fc94213dc1769d6cb1a1f756f62d 100644 +index f1128f0d4a9a0241ac6c9bc18dd13b431c616bb1..2b2b7851d5f68bcdb41d58bcc64740ba58bf1ef4 100644 --- a/src/main/java/net/minecraft/server/level/Ticket.java +++ b/src/main/java/net/minecraft/server/level/Ticket.java @@ -8,6 +8,7 @@ public final class Ticket implements Comparable> { - public final T key; public final T getObjectReason() { return this.key; } // Paper - OBFHELPER - private long createdTick; public final long getCreationTick() { return this.createdTick; } // Paper - OBFHELPER + public final T key; + public long createdTick; public long delayUnloadBy; // Paper + public int priority; // Paper - Chunk priority @@ -1144,7 +1144,7 @@ index 66735bbc2528c5812c9df14ef7cd91cb69d903b2..8ebbbecaebea8435232a2ccd9ad1062e entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index b410001403e4a984e1ea7f5fdb3adc866631e80f..3eaf72f49d8e520c6f3d2fea2818864018b41732 100644 +index 6c4c82fb439a07f62668b625b6ba5d552949964d..6ddef28e869ae8f3b3cbc4bacc44abc364d036d8 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -223,7 +223,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n diff --git a/patches/server/0491-Fix-arrows-never-despawning-MC-125757.patch b/patches/server/0491-Fix-arrows-never-despawning-MC-125757.patch index 06ffd52487..a82f3afb6a 100644 --- a/patches/server/0491-Fix-arrows-never-despawning-MC-125757.patch +++ b/patches/server/0491-Fix-arrows-never-despawning-MC-125757.patch @@ -9,22 +9,14 @@ instead of getting stuck in a never despawn state (bubble columns, etc). diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 65faf775b786f9c237ee33c1fb0f8ab9f37d738c..8b91d86b8d5594d526e5ce7943572b91c70ef7f2 100644 +index 65faf775b786f9c237ee33c1fb0f8ab9f37d738c..6636845ea044c3810e1880aad8b679134cd33668 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -198,6 +198,7 @@ public abstract class AbstractArrow extends Projectile { ++this.inGroundTime; } else { -+ if (tickCount > 200) this.tickDespawnCounter(); // Paper - tick despawnCounter regardless after 10 seconds ++ if (tickCount > 200) this.tickDespawn(); // Paper - tick despawnCounter regardless after 10 seconds this.inGroundTime = 0; Vec3 vec3d2 = this.position(); -@@ -319,6 +320,7 @@ public abstract class AbstractArrow extends Projectile { - - } - -+ protected final void tickDespawnCounter() { this.tickDespawn(); } // Paper - OBFHELPER - protected void tickDespawn() { - ++this.life; - if (this.life >= (pickup == Pickup.CREATIVE_ONLY ? level.paperConfig.creativeArrowDespawnRate : (pickup == Pickup.DISALLOWED ? level.paperConfig.nonPlayerArrowDespawnRate : ((this instanceof ThrownTrident) ? level.spigotConfig.tridentDespawnRate : level.spigotConfig.arrowDespawnRate)))) { // Spigot // Paper - TODO: Extract this to init? diff --git a/patches/server/0526-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0526-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index 7dcfece97e..ecd3667e58 100644 --- a/patches/server/0526-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0526-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2177e7aaf80ac715052e678fd77c1b9578a5b2e8..550130ff6ab386bc7b45758d637f20b17cbee2eb 100644 +index 2b227fcea38a9c01b15ec7d79503ba089d32bcb0..545f000d51441b456305417025ae768aed500c53 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3925,4 +3925,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -3924,4 +3924,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n void accept(Entity entity, double x, double y, double z); } diff --git a/patches/server/0528-Entity-isTicking.patch b/patches/server/0528-Entity-isTicking.patch index edec90ed47..bd2e6b7ee7 100644 --- a/patches/server/0528-Entity-isTicking.patch +++ b/patches/server/0528-Entity-isTicking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity#isTicking diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 550130ff6ab386bc7b45758d637f20b17cbee2eb..d698fefd5d492bc6fe8b9e7d07108d6ba77d8576 100644 +index 545f000d51441b456305417025ae768aed500c53..1bb27f0d3c990667f0547dc673e5aec977436446 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -52,6 +52,7 @@ import net.minecraft.resources.ResourceKey; @@ -16,7 +16,7 @@ index 550130ff6ab386bc7b45758d637f20b17cbee2eb..d698fefd5d492bc6fe8b9e7d07108d6b import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.TicketType; -@@ -3930,5 +3931,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -3929,5 +3930,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n public static int nextEntityId() { return ENTITY_COUNTER.incrementAndGet(); } diff --git a/patches/server/0530-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch b/patches/server/0530-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch index fd61649152..fcb421447d 100644 --- a/patches/server/0530-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch +++ b/patches/server/0530-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix CME on adding a passenger in CreatureSpawnEvent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d698fefd5d492bc6fe8b9e7d07108d6ba77d8576..f562f29193f30ac38112a1e9db45da4efe10eeb0 100644 +index 1bb27f0d3c990667f0547dc673e5aec977436446..b5c700c8af6e7d375052683811f87046e400ae45 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3434,7 +3434,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -3433,7 +3433,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n } private Stream getIndirectPassengersStream() { diff --git a/patches/server/0567-MC-4-Fix-item-position-desync.patch b/patches/server/0567-MC-4-Fix-item-position-desync.patch index 5ae216c7d7..e3db8cbd64 100644 --- a/patches/server/0567-MC-4-Fix-item-position-desync.patch +++ b/patches/server/0567-MC-4-Fix-item-position-desync.patch @@ -41,10 +41,10 @@ index b30c08bfb8c55161543a4ef09f2e462e0a1fe4ae..ec93f5300cc7d423ec0d292f0f8443f9 public Vec3 updateEntityPosition(Vec3 orig) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index bb6ee8e9c7665ab5c88b71dc68269c79997dc024..7194e2b51ab8aca929eb970e0a6ff31a07a4c09f 100644 +index 0ed626fa9299d34ce5d63e6cddd30480ee62d52b..46b10bb5480bf792da0fdfbb2797d0ac9ad81477 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3752,6 +3752,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -3751,6 +3751,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n } public final void setPosRaw(double x, double y, double z) { diff --git a/patches/server/0580-Fix-Not-a-string-Map-Conversion-spam.patch b/patches/server/0580-Fix-Not-a-string-Map-Conversion-spam.patch index 53e0aa985b..7aac87fe22 100644 --- a/patches/server/0580-Fix-Not-a-string-Map-Conversion-spam.patch +++ b/patches/server/0580-Fix-Not-a-string-Map-Conversion-spam.patch @@ -12,7 +12,7 @@ requesting the world. Track spigot issue to see when fixed: https://hub.spigotmc.org/jira/browse/SPIGOT-6181 diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java -index 15c6f9d1c43fbedac70526a84a010be83b4cae86..e90cb274ae07a259b90ec2badf35980ba684c5b1 100644 +index 15c6f9d1c43fbedac70526a84a010be83b4cae86..2e5155fe541ed7040a6be9fdec98b23e8c45bfb0 100644 --- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java +++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java @@ -14,6 +14,8 @@ import net.minecraft.core.BlockPos; @@ -39,12 +39,12 @@ index 15c6f9d1c43fbedac70526a84a010be83b4cae86..e90cb274ae07a259b90ec2badf35980b + UUID uuid = new UUID(most, least); + CraftWorld world = (CraftWorld) Bukkit.getWorld(uuid); + if (world != null) { -+ dimension = StringTag.create("minecraft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH)); ++ dimension = StringTag.valueOf("minecraft:" + world.getName().toLowerCase(java.util.Locale.ENGLISH)); + } else { -+ dimension = StringTag.create("bukkit:_invalidworld_"); ++ dimension = StringTag.valueOf("bukkit:_invalidworld_"); + } + } else { -+ dimension = StringTag.create("bukkit:_invalidworld_"); ++ dimension = StringTag.valueOf("bukkit:_invalidworld_"); + } + } + DataResult> dataresult = DimensionType.parseLegacy(new Dynamic(NbtOps.INSTANCE, dimension)); // CraftBukkit - decompile error diff --git a/patches/server/0629-Throw-proper-exception-on-empty-JsonList-file.patch b/patches/server/0629-Throw-proper-exception-on-empty-JsonList-file.patch index 5350e561c4..792a4f6675 100644 --- a/patches/server/0629-Throw-proper-exception-on-empty-JsonList-file.patch +++ b/patches/server/0629-Throw-proper-exception-on-empty-JsonList-file.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Throw proper exception on empty JsonList file diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java -index 4b85943a704e0a5ca6b95f9cfcbfd1f9505c3b68..bfac2eb1ad06e82fed92574c1dd07e33f1440db7 100644 +index 0851dca56ae680387d56b3fdc894746c248604f5..a492f20328e0a4789fbdd1c2c84473d1958143ac 100644 --- a/src/main/java/net/minecraft/server/players/StoredUserList.java +++ b/src/main/java/net/minecraft/server/players/StoredUserList.java -@@ -189,6 +189,7 @@ public abstract class StoredUserList> { +@@ -187,6 +187,7 @@ public abstract class StoredUserList> { try { JsonArray jsonarray = (JsonArray) StoredUserList.GSON.fromJson(bufferedreader, JsonArray.class); diff --git a/patches/server/0633-Add-worldborder-events.patch b/patches/server/0633-Add-worldborder-events.patch index a78c112f12..1af06a9e0e 100644 --- a/patches/server/0633-Add-worldborder-events.patch +++ b/patches/server/0633-Add-worldborder-events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add worldborder events diff --git a/src/main/java/net/minecraft/world/level/border/WorldBorder.java b/src/main/java/net/minecraft/world/level/border/WorldBorder.java -index 4a61153eaf9cf4c8aa532f770c0e449325448107..a30cd5a649a3086b794f1cb03bc0e02846b2f558 100644 +index dd49122fada9729a44fc040ffa1f57eb6ac5a124..6028e65c7e5afeea87f14edb16415defe89ebffa 100644 --- a/src/main/java/net/minecraft/world/level/border/WorldBorder.java +++ b/src/main/java/net/minecraft/world/level/border/WorldBorder.java -@@ -110,15 +110,19 @@ public class WorldBorder { +@@ -109,15 +109,19 @@ public class WorldBorder { } public void setCenter(double x, double z) { @@ -31,7 +31,7 @@ index 4a61153eaf9cf4c8aa532f770c0e449325448107..a30cd5a649a3086b794f1cb03bc0e028 } } -@@ -136,25 +140,43 @@ public class WorldBorder { +@@ -135,25 +139,43 @@ public class WorldBorder { } public void setSize(double size) { @@ -79,7 +79,7 @@ index 4a61153eaf9cf4c8aa532f770c0e449325448107..a30cd5a649a3086b794f1cb03bc0e028 } } -@@ -459,6 +481,7 @@ public class WorldBorder { +@@ -458,6 +480,7 @@ public class WorldBorder { @Override public WorldBorder.BorderExtent update() {