diff options
author | Nassim Jahnke <[email protected]> | 2024-10-31 22:44:48 +0100 |
---|---|---|
committer | Nassim Jahnke <[email protected]> | 2024-10-31 22:44:48 +0100 |
commit | 77a522bb046ada07bc520a3df4f76d587708e337 (patch) | |
tree | 3b6aed30046562b2de8faf72e32d97db5b20ab0c /patches/server | |
parent | c5c125079c47f35c6b91d8c989964cd86293ef86 (diff) | |
download | Paper-77a522bb046ada07bc520a3df4f76d587708e337.tar.gz Paper-77a522bb046ada07bc520a3df4f76d587708e337.zip |
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
97c59261 PR-1073: Make Biome an interface
a38581aa Fix further javadoc errors
8271c490 Fix javadoc error
8a9ecf29 PR-1072: Fix bad naming for Vault State methods
6dd58108 PR-1071: Make Fluid an interface and add missing entry
ed2cdfc3 PR-1070: Make Attribute an interface and align names with the new minecraft ones
63472efb PR-1069: Add missing winter drop experimental annotation to pale boats
CraftBukkit Changes:
7235ad7b0 PR-1501: Make Biome an interface
602904003 PR-1500: Rename implementation for Vault State methods
75f26f79f PR-1499: Make Fluid an interface and add missing entry
4cfd87adc PR-1498: Make Attribute an interface and align names with the new minecraft ones
6bb0db5cb SPIGOT-7928: ExactChoice acts as MaterialChoice
3eaf3a13c SPIGOT-7929: Error when setting EquippableComponent
abbf57bac SPIGOT-7930: Fix spawning entities with SummonEntityEffect
92d6ab6cf PR-1497: Move boat field rename entries to below key renaming, so that keys are also renamed
abfe292aa PR-1496: Use correct Fluid class on Tags type check
c7aab7fa7 SPIGOT-7923: Fix Dispenser logic to avoid firing empty projectiles
Diffstat (limited to 'patches/server')
40 files changed, 163 insertions, 177 deletions
diff --git a/patches/server/0008-CB-fixes.patch b/patches/server/0008-CB-fixes.patch index 3c0b7b9d42..50afbc86c9 100644 --- a/patches/server/0008-CB-fixes.patch +++ b/patches/server/0008-CB-fixes.patch @@ -31,19 +31,6 @@ index a17846ccd8581c3d6da962e977623aaab8314ec7..f6a3606b972064c4ec78487374e6197c this.structureManager = new StructureManager(this, this.serverLevelData.worldGenOptions(), this.structureCheck); // CraftBukkit if ((this.dimension() == Level.END && this.dimensionTypeRegistration().is(BuiltinDimensionTypes.END)) || env == org.bukkit.World.Environment.THE_END) { // CraftBukkit - Allow to create EnderDragonBattle in default and custom END this.dragonFight = new EndDragonFight(this, this.serverLevelData.worldGenOptions().seed(), this.serverLevelData.endDragonFightData()); // CraftBukkit -diff --git a/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java b/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java -index ed78039b89884c41ce10d520786c5b56f7d9b154..0239495abcc7b796864976b37ece184efa9a747e 100644 ---- a/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java -+++ b/src/main/java/net/minecraft/world/item/enchantment/effects/SummonEntityEffect.java -@@ -54,7 +54,7 @@ public record SummonEntityEffect(HolderSet<EntityType<?>> entityTypes, boolean j - // CraftBukkit start - world.strikeLightning(entity1, (context.itemStack().getItem() == Items.TRIDENT) ? LightningStrikeEvent.Cause.TRIDENT : LightningStrikeEvent.Cause.ENCHANTMENT); - } else { -- world.addFreshEntityWithPassengers(user, CreatureSpawnEvent.SpawnReason.ENCHANTMENT); -+ world.addFreshEntityWithPassengers(entity1, CreatureSpawnEvent.SpawnReason.ENCHANTMENT); // Paper - Fix typo when adding summoned entity - // CraftBukkit end - } - diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java index 4f68394a94308513269f0a4c749b6a36738e3ca0..953ab7638f7242b5a11dd1de8786172443a0558c 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructureCheck.java @@ -115,10 +102,10 @@ index 163d54a8bf4cedbd1471e86b7ab1a1b850ed3f39..6effe47b32a8551aa6f6b11bc0315714 public class CraftScheduler implements BukkitScheduler { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index e95c367d1c14dc28b1bf83cc461c80f454af22af..5187d48ba067d0edf55fecfc912ae5ac34452da3 100644 +index 7d39ed941cd0567d01122469a36d7a645b5aeeba..c101b342e4f0c154a35f6268253d9c30d97a98c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -246,7 +246,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -247,7 +247,7 @@ public final class CraftMagicNumbers implements UnsafeValues { try { nmsStack.applyComponents(new ItemParser(Commands.createValidationContext(MinecraftServer.getDefaultRegistryAccess())).parse(new StringReader(arguments)).components()); } catch (CommandSyntaxException ex) { diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 7375271d20..827ba628ff 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -3331,7 +3331,7 @@ index 49c037e961c5ca5ba8d6a870cb32ffe8719adc91..2772c19f58a35713d61aab24f6f0d6f5 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index eb61712ea067b277e7f32f887e3528faca275450..16a9142bdbbfbbbb69d1486bd119dc610094484b 100644 +index 49102177454765b8e53d0d7f47fe4bf4a33549af..c3fc8b1abe843a19347509947f4b864c1b417800 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -648,8 +648,10 @@ public final class CraftServer implements Server { @@ -5202,7 +5202,7 @@ index c71a4971f127fdfc753306019313ce1a31201120..fd3b12477c30d1eabdbe57ea77902793 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index bc68a45af66699f013851869646a2c11d5a871ee..626fe2af05fecd41b777b5dd5decbedb2f17b43a 100644 +index 5dea83c1a0de4e5123430bf2f902a78969021167..2e524520308dda7ce7df98d91c89a9cfe7542862 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -1097,6 +1097,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -5635,10 +5635,10 @@ index ff040613083c015d9c52c0995591b64305fd5018..95444fd9fecc5bda5462ca8dfeca82c5 boolean hadFormat = false; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 5187d48ba067d0edf55fecfc912ae5ac34452da3..aa02e932ea19325694b1058d749b0858465530e8 100644 +index c101b342e4f0c154a35f6268253d9c30d97a98c3..54551723c6a6aae63edee6034ef8b8d20760cf11 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -79,6 +79,43 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -80,6 +80,43 @@ public final class CraftMagicNumbers implements UnsafeValues { private CraftMagicNumbers() {} diff --git a/patches/server/0019-Paper-Plugins.patch b/patches/server/0019-Paper-Plugins.patch index 2ca42e58a6..71fc842f89 100644 --- a/patches/server/0019-Paper-Plugins.patch +++ b/patches/server/0019-Paper-Plugins.patch @@ -7257,7 +7257,7 @@ index 9bd6056bba6ba48bada7e9cd5883b0a171b0bbc4..7399358f18dc7869fbfe414186cf1841 Bootstrap.validate(); Util.startTimerHackThread(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 1b66c5173dd37433d895c0d804257141a3a8c588..e8c1ceed228a1dfb9f3c76b54a91d712c511ffb5 100644 +index 4ec8731a48f81aff33c7d8bcfe00dea263735e48..600e865688b423d9bb4338f413dc28418ba37748 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -280,7 +280,8 @@ public final class CraftServer implements Server { @@ -7329,10 +7329,10 @@ index 1b66c5173dd37433d895c0d804257141a3a8c588..e8c1ceed228a1dfb9f3c76b54a91d712 this.enablePlugins(PluginLoadOrder.STARTUP); this.enablePlugins(PluginLoadOrder.POSTWORLD); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index aa02e932ea19325694b1058d749b0858465530e8..0ff9c62636e8709a6df252e9aaf931c9c17bd9bf 100644 +index 54551723c6a6aae63edee6034ef8b8d20760cf11..3c9cdb8c67d2704caac6488a6216d8c9c8a009ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -401,6 +401,16 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -402,6 +402,16 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.asNMSCopy(itemStack); return nmsItemStack.getItem().getDescriptionId(); } diff --git a/patches/server/0021-Hook-into-CB-plugin-rewrites.patch b/patches/server/0021-Hook-into-CB-plugin-rewrites.patch index 036deead6e..4b98c18cbf 100644 --- a/patches/server/0021-Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/0021-Hook-into-CB-plugin-rewrites.patch @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390cb9129cd 100644 +index 79b386af9eb2450b0a8abe3342bc53d3f0b86fd9..58df23162aed12f3058b5e0921a9e30b89f56a10 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -12,6 +12,7 @@ import java.util.Arrays; @@ -27,7 +27,7 @@ index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390 import joptsimple.OptionParser; import joptsimple.OptionSet; import joptsimple.OptionSpec; -@@ -123,6 +125,40 @@ public class Commodore { +@@ -126,6 +128,40 @@ public class Commodore { return this.reroutes; } @@ -68,7 +68,7 @@ index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390 public static void main(String[] args) { OptionParser parser = new OptionParser(); OptionSpec<File> inputFlag = parser.acceptsAll(Arrays.asList("i", "input")).withRequiredArg().ofType(File.class).required(); -@@ -278,9 +314,49 @@ public class Commodore { +@@ -281,9 +317,49 @@ public class Commodore { } return new MethodVisitor(this.api, super.visitMethod(access, name, desc, signature, exceptions)) { @@ -118,7 +118,7 @@ index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390 name = FieldRename.rename(pluginVersion, owner, name); if (modern) { -@@ -393,6 +469,13 @@ public class Commodore { +@@ -396,6 +472,13 @@ public class Commodore { return; } @@ -132,7 +132,7 @@ index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390 if (modern) { if (owner.equals("org/bukkit/Material") || (instantiatedMethodType != null && instantiatedMethodType.getDescriptor().startsWith("(Lorg/bukkit/Material;)"))) { switch (name) { -@@ -489,6 +572,13 @@ public class Commodore { +@@ -492,6 +575,13 @@ public class Commodore { @Override public void visitLdcInsn(Object value) { @@ -146,7 +146,7 @@ index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390 if (value instanceof String && ((String) value).equals("com.mysql.jdbc.Driver")) { super.visitLdcInsn("com.mysql.cj.jdbc.Driver"); return; -@@ -499,6 +589,14 @@ public class Commodore { +@@ -502,6 +592,14 @@ public class Commodore { @Override public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) { @@ -161,7 +161,7 @@ index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390 if (bootstrapMethodHandle.getOwner().equals("java/lang/invoke/LambdaMetafactory") && bootstrapMethodHandle.getName().equals("metafactory") && bootstrapMethodArguments.length == 3) { Type samMethodType = (Type) bootstrapMethodArguments[0]; -@@ -515,7 +613,7 @@ public class Commodore { +@@ -518,7 +616,7 @@ public class Commodore { methodArgs.add(new Handle(newOpcode, newOwner, newName, newDescription, newItf)); methodArgs.add(newInstantiated); @@ -170,7 +170,7 @@ index b60b715af8c3259aed8d386a5165653e0b6ed667..2a29f60c3e82239ab7acd85242fc3390 }, implMethod.getTag(), implMethod.getOwner(), implMethod.getName(), implMethod.getDesc(), implMethod.isInterface(), samMethodType, instantiatedMethodType); return; } -@@ -566,6 +664,12 @@ public class Commodore { +@@ -569,6 +667,12 @@ public class Commodore { @Override public FieldVisitor visitField(int access, String name, String descriptor, String signature, Object value) { diff --git a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch index 3610187c20..d424e1f6fc 100644 --- a/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch +++ b/patches/server/0022-Remap-reflection-calls-in-plugins-using-internals.patch @@ -645,10 +645,10 @@ index 242811578a786e3807a1a7019d472d5a68f87116..0b65fdf53124f3dd042b2363b1b8df8e return traceElements; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 2a29f60c3e82239ab7acd85242fc3390cb9129cd..91c6721201b095eb32c5fd5a1aaf2cbcf3ee196d 100644 +index 58df23162aed12f3058b5e0921a9e30b89f56a10..ba104635c7713b04ce624bc4c7bd390462bc0edb 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -126,36 +126,26 @@ public class Commodore { +@@ -129,36 +129,26 @@ public class Commodore { } // Paper start - Plugin rewrites @@ -696,7 +696,7 @@ index 2a29f60c3e82239ab7acd85242fc3390cb9129cd..91c6721201b095eb32c5fd5a1aaf2cbc } // Paper end - Plugin rewrites -@@ -240,6 +230,7 @@ public class Commodore { +@@ -243,6 +233,7 @@ public class Commodore { visitor = new LimitedClassRemapper(cw, new SimpleRemapper(Commodore.ENUM_RENAMES)); } @@ -705,10 +705,10 @@ index 2a29f60c3e82239ab7acd85242fc3390cb9129cd..91c6721201b095eb32c5fd5a1aaf2cbc final Set<RerouteMethodData> rerouteMethodData = new HashSet<>(); String className; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 0ff9c62636e8709a6df252e9aaf931c9c17bd9bf..4b2377a1de608b9142a28c66389d04290f7c0330 100644 +index 3c9cdb8c67d2704caac6488a6216d8c9c8a009ef..ab4dd5a86ccd8e9878abf95417bb05ceb91dd19c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -74,6 +74,7 @@ import org.bukkit.potion.PotionType; +@@ -75,6 +75,7 @@ import org.bukkit.potion.PotionType; @SuppressWarnings("deprecation") public final class CraftMagicNumbers implements UnsafeValues { public static final CraftMagicNumbers INSTANCE = new CraftMagicNumbers(); @@ -716,7 +716,7 @@ index 0ff9c62636e8709a6df252e9aaf931c9c17bd9bf..4b2377a1de608b9142a28c66389d0429 private final Commodore commodore = new Commodore(); -@@ -346,7 +347,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -347,7 +348,7 @@ public final class CraftMagicNumbers implements UnsafeValues { throw new InvalidPluginException("Plugin API version " + pdf.getAPIVersion() + " is lower than the minimum allowed version. Please update or replace it."); } @@ -725,7 +725,7 @@ index 0ff9c62636e8709a6df252e9aaf931c9c17bd9bf..4b2377a1de608b9142a28c66389d0429 CraftLegacy.init(); } -@@ -361,6 +362,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -362,6 +363,12 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public byte[] processClass(PluginDescriptionFile pdf, String path, byte[] clazz) { diff --git a/patches/server/0033-Expose-server-build-information.patch b/patches/server/0033-Expose-server-build-information.patch index 83f13af41a..a6d2360581 100644 --- a/patches/server/0033-Expose-server-build-information.patch +++ b/patches/server/0033-Expose-server-build-information.patch @@ -590,7 +590,7 @@ index f077b8ff0bf0d96628db3569132696b68fd79921..5f11f5b16766f9d1d5640ae037e259be value.append("\n Plugins: {"); for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index db7cad60c8f805dd1b4089673f5f9d073a429a67..2bfa790a9f0ca07217c9d9f7dd916950d859530c 100644 +index f4c36880ca29d657d0b443d9578265bd84e007c7..f0ae14146015d8145cf873788559b8f0666f7f33 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -11,8 +11,6 @@ import com.google.common.collect.MapMaker; @@ -692,11 +692,11 @@ index 03790abcc3474999db6d8986e50ebc2caf6eba0c..13f811173c67533ee02f70cc4b6b398c t.printStackTrace(); } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 4b2377a1de608b9142a28c66389d04290f7c0330..2b60572307e3ec23e21e09c34a04de9a1c57f136 100644 +index ab4dd5a86ccd8e9878abf95417bb05ceb91dd19c..61efb305e25b23fe6309276e15efdb41a46c7738 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -464,6 +464,13 @@ public final class CraftMagicNumbers implements UnsafeValues { - return CraftRegistry.get(registry, namespacedKey, ApiVersion.CURRENT); +@@ -475,6 +475,13 @@ public final class CraftMagicNumbers implements UnsafeValues { + return this.customBiome; } + // Paper start diff --git a/patches/server/0176-Player.setPlayerProfile-API.patch b/patches/server/0176-Player.setPlayerProfile-API.patch index d971b0d455..42216ef379 100644 --- a/patches/server/0176-Player.setPlayerProfile-API.patch +++ b/patches/server/0176-Player.setPlayerProfile-API.patch @@ -207,10 +207,10 @@ index 128fcd537783986d816dae6d1ce2afb7af07d45a..32eeca2467189c6c97f7da5529d4fe93 public void onEntityRemove(Entity entity) { this.invertedVisibilityEntities.remove(entity.getUUID()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 91c6721201b095eb32c5fd5a1aaf2cbcf3ee196d..b85223ebff4dbb8aa74b501663afc87ef11e2a96 100644 +index ba104635c7713b04ce624bc4c7bd390462bc0edb..9a6857f325d72c1b5ce403c3240e0b1a3f43bc38 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -467,6 +467,13 @@ public class Commodore { +@@ -470,6 +470,13 @@ public class Commodore { } // Paper end - Rewrite plugins diff --git a/patches/server/0241-Improve-death-events.patch b/patches/server/0241-Improve-death-events.patch index 0dd8702773..00939c177d 100644 --- a/patches/server/0241-Improve-death-events.patch +++ b/patches/server/0241-Improve-death-events.patch @@ -440,7 +440,7 @@ index e4d840d6335007a6a542240746504bf1f2af332d..159bba49095aec77cce5f53d4388a5df public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 474f330f381aa74e9f2fd0accdbaf2617ec1c557..199abd66d2113e7bc8c478fe8e4f6657d2e12304 100644 +index 474f330f381aa74e9f2fd0accdbaf2617ec1c557..b537b3ac2ed238c01ec76ccc7941a09bfc959c10 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -902,8 +902,15 @@ public class CraftEventFactory { @@ -481,7 +481,7 @@ index 474f330f381aa74e9f2fd0accdbaf2617ec1c557..199abd66d2113e7bc8c478fe8e4f6657 + // Paper start - helper methods for making death event cancellable + // Add information to death event + private static void populateFields(net.minecraft.world.entity.LivingEntity victim, EntityDeathEvent event) { -+ event.setReviveHealth(event.getEntity().getAttribute(org.bukkit.attribute.Attribute.GENERIC_MAX_HEALTH).getValue()); ++ event.setReviveHealth(event.getEntity().getAttribute(org.bukkit.attribute.Attribute.MAX_HEALTH).getValue()); + event.setShouldPlayDeathSound(!victim.silentDeath && !victim.isSilent()); + net.minecraft.sounds.SoundEvent soundEffect = victim.getDeathSound(); + event.setDeathSound(soundEffect != null ? org.bukkit.craftbukkit.CraftSound.minecraftToBukkit(soundEffect) : null); diff --git a/patches/server/0324-Add-Raw-Byte-ItemStack-Serialization.patch b/patches/server/0324-Add-Raw-Byte-ItemStack-Serialization.patch index 3895429c44..70ced2037c 100644 --- a/patches/server/0324-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/patches/server/0324-Add-Raw-Byte-ItemStack-Serialization.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization Serializes using NBT which is safer for server data migrations than bukkits format. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 2b60572307e3ec23e21e09c34a04de9a1c57f136..150ab63f231fc3c39661ab876a8c90d608ee8568 100644 +index 61efb305e25b23fe6309276e15efdb41a46c7738..b50d1ddfd23bf1af16d86e5edcb72196b4674868 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -469,6 +469,53 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -480,6 +480,53 @@ public final class CraftMagicNumbers implements UnsafeValues { public com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() { return new com.destroystokyo.paper.PaperVersionFetcher(); } diff --git a/patches/server/0401-Add-methods-to-get-translation-keys.patch b/patches/server/0401-Add-methods-to-get-translation-keys.patch index 8ff2f02eb9..de167b55e7 100644 --- a/patches/server/0401-Add-methods-to-get-translation-keys.patch +++ b/patches/server/0401-Add-methods-to-get-translation-keys.patch @@ -10,6 +10,22 @@ public org.bukkit.craftbukkit.inventory.CraftMetaFirework getNBT(Lorg/bukkit/Fir Co-authored-by: MeFisto94 <[email protected]> +diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java +index 8797a47be16b85dc69a28a56bb355bee7d6b1a78..9ab615347e241ac264fb70f43306075907420885 100644 +--- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java ++++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java +@@ -98,6 +98,11 @@ public class CraftAttribute implements Attribute, Handleable<net.minecraft.world + return this.attributeBase.getDescriptionId(); + } + ++ @Override ++ public @NotNull String translationKey() { ++ return this.attributeBase.getDescriptionId(); ++ } ++ + @Override + public int compareTo(@NotNull Attribute attribute) { + return this.ordinal - attribute.ordinal(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index aae00320ab8003420bae5de7df47f553b62c5aab..3fa3de9a89550ec2fcb8ca663742826c0c3136b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java diff --git a/patches/server/0408-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch b/patches/server/0408-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch index 4a538824cb..71b2a9d8d1 100644 --- a/patches/server/0408-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch +++ b/patches/server/0408-Expose-the-Entity-Counter-to-allow-plugins-to-use-va.patch @@ -21,10 +21,10 @@ index 2c9e57436469f94beb45f656a1df71aba7b1e408..c3e28cc070993be5afe9323c2c2d54ff + // Paper end - Expose entity id counter } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 150ab63f231fc3c39661ab876a8c90d608ee8568..93505eba28d9fb20ce25866e932fc1cdcb006db8 100644 +index b50d1ddfd23bf1af16d86e5edcb72196b4674868..09a6a0c06580aea9e7be8de2189673d1a476f411 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -516,6 +516,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -527,6 +527,11 @@ public final class CraftMagicNumbers implements UnsafeValues { Preconditions.checkArgument(dataVersion <= getDataVersion(), "Newer version! Server downgrades are not supported!"); return compound; } diff --git a/patches/server/0424-Fix-client-lag-on-advancement-loading.patch b/patches/server/0424-Fix-client-lag-on-advancement-loading.patch index 67c377a6f1..c7284e1f8b 100644 --- a/patches/server/0424-Fix-client-lag-on-advancement-loading.patch +++ b/patches/server/0424-Fix-client-lag-on-advancement-loading.patch @@ -15,10 +15,10 @@ manually reload the advancement data for all players, which normally takes place as a part of the datapack reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 93505eba28d9fb20ce25866e932fc1cdcb006db8..af8fde74b3162d2de740ecae1122b4f2115baeb6 100644 +index 09a6a0c06580aea9e7be8de2189673d1a476f411..e88b384e3d640dd77e419611f3c0e588fbf4f406 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -317,7 +317,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -318,7 +318,13 @@ public final class CraftMagicNumbers implements UnsafeValues { Bukkit.getLogger().log(Level.SEVERE, "Error saving advancement " + key, ex); } diff --git a/patches/server/0467-Add-RegistryAccess-for-managing-Registries.patch b/patches/server/0467-Add-RegistryAccess-for-managing-Registries.patch index ccdf448b22..5700837572 100644 --- a/patches/server/0467-Add-RegistryAccess-for-managing-Registries.patch +++ b/patches/server/0467-Add-RegistryAccess-for-managing-Registries.patch @@ -12,10 +12,10 @@ public net.minecraft.server.RegistryLayer STATIC_ACCESS diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java new file mode 100644 -index 0000000000000000000000000000000000000000..633b01431750d4b40159a57bf25fb35c6670ff1b +index 0000000000000000000000000000000000000000..24a763b2ae635f19032696bb1feeb3b3aa72f0fd --- /dev/null +++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java -@@ -0,0 +1,146 @@ +@@ -0,0 +1,152 @@ +package io.papermc.paper.registry; + +import io.papermc.paper.adventure.PaperAdventure; @@ -32,11 +32,15 @@ index 0000000000000000000000000000000000000000..633b01431750d4b40159a57bf25fb35c +import org.bukkit.JukeboxSong; +import org.bukkit.Keyed; +import org.bukkit.MusicInstrument; ++import org.bukkit.attribute.Attribute; ++import org.bukkit.block.Biome; +import org.bukkit.block.BlockType; +import org.bukkit.block.banner.PatternType; +import org.bukkit.craftbukkit.CraftGameEvent; +import org.bukkit.craftbukkit.CraftJukeboxSong; +import org.bukkit.craftbukkit.CraftMusicInstrument; ++import org.bukkit.craftbukkit.attribute.CraftAttribute; ++import org.bukkit.craftbukkit.block.CraftBiome; +import org.bukkit.craftbukkit.block.CraftBlockType; +import org.bukkit.craftbukkit.block.banner.CraftPatternType; +import org.bukkit.craftbukkit.damage.CraftDamageType; @@ -98,6 +102,7 @@ index 0000000000000000000000000000000000000000..633b01431750d4b40159a57bf25fb35c + entry(Registries.VILLAGER_TYPE, RegistryKey.VILLAGER_TYPE, Villager.Type.class, CraftVillager.CraftType::new), + entry(Registries.MAP_DECORATION_TYPE, RegistryKey.MAP_DECORATION_TYPE, MapCursor.Type.class, CraftMapCursor.CraftType::new), + entry(Registries.MENU, RegistryKey.MENU, MenuType.class, CraftMenuType::new), ++ entry(Registries.ATTRIBUTE, RegistryKey.ATTRIBUTE, Attribute.class, CraftAttribute::new), + + // data-drivens + entry(Registries.STRUCTURE, RegistryKey.STRUCTURE, Structure.class, CraftStructure::new).delayed(), @@ -108,6 +113,7 @@ index 0000000000000000000000000000000000000000..633b01431750d4b40159a57bf25fb35c + entry(Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, Enchantment.class, CraftEnchantment::new).withSerializationUpdater(FieldRename.ENCHANTMENT_RENAME).delayed(), + entry(Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, JukeboxSong.class, CraftJukeboxSong::new).delayed(), + entry(Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, PatternType.class, CraftPatternType::new).delayed(), ++ entry(Registries.BIOME, RegistryKey.BIOME, Biome.class, CraftBiome::new).delayed(), + + // api-only + apiOnly(Registries.BIOME, RegistryKey.BIOME, () -> org.bukkit.Registry.BIOME), @@ -743,10 +749,10 @@ index 8e8d6214adbd21a221147f0fc0d91cd9c06a080c..6fddef967b6314ca0158f5bd4b889867 String string = Registries.elementsDirPath(type.registryKey()); SimpleJsonResourceReloadListener.scanDirectory(resourceManager, string, ops, type.codec(), map); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index b4ed857f2437759b71b75d7ab36c986a2fd71dbc..09929f580164abcd1c04061d04c6aa992767e256 100644 +index d7e3371ebc08b5534c259ea45d89a969dfbe491a..16985dc1f54d64c44f96b045012612f16ba9ae8a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -122,81 +122,12 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -125,90 +125,12 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { + ", this can happen if a plugin creates its own registry entry with out properly registering it."); } @@ -758,9 +764,18 @@ index b4ed857f2437759b71b75d7ab36c986a2fd71dbc..09929f580164abcd1c04061d04c6aa99 - * @return the bukkit registry of the provided class - */ - public static <B extends Keyed> Registry<?> createRegistry(Class<? super B> bukkitClass, RegistryAccess registryHolder) { +- if (bukkitClass == Attribute.class) { +- return new CraftRegistry<>(Attribute.class, registryHolder.lookupOrThrow(Registries.ATTRIBUTE), CraftAttribute::new, FieldRename.ATTRIBUTE_RENAME); +- } +- if (bukkitClass == Biome.class) { +- return new CraftRegistry<>(Biome.class, registryHolder.lookupOrThrow(Registries.BIOME), CraftBiome::new, FieldRename.BIOME_RENAME); +- } - if (bukkitClass == Enchantment.class) { - return new CraftRegistry<>(Enchantment.class, registryHolder.lookupOrThrow(Registries.ENCHANTMENT), CraftEnchantment::new, FieldRename.ENCHANTMENT_RENAME); - } +- if (bukkitClass == Fluid.class) { +- return new CraftRegistry<>(Fluid.class, registryHolder.lookupOrThrow(Registries.FLUID), CraftFluid::new, FieldRename.NONE); +- } - if (bukkitClass == GameEvent.class) { - return new CraftRegistry<>(GameEvent.class, registryHolder.lookupOrThrow(Registries.GAME_EVENT), CraftGameEvent::new, FieldRename.NONE); - } @@ -831,7 +846,7 @@ index b4ed857f2437759b71b75d7ab36c986a2fd71dbc..09929f580164abcd1c04061d04c6aa99 } if (bukkit instanceof Registry.SimpleRegistry<?> simple) { -@@ -222,23 +153,21 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -226,23 +148,21 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { return bukkit.get(namespacedKey); } @@ -861,7 +876,7 @@ index b4ed857f2437759b71b75d7ab36c986a2fd71dbc..09929f580164abcd1c04061d04c6aa99 @Override public B get(NamespacedKey namespacedKey) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 30675a23a25dc065e09d97b9b08386c9f41989d8..a12dc990a9094e964be2af26a5135e3b798f9666 100644 +index 1c30369a2ed1577d7fb8457f9751de2d32634d29..45ddb643d544dbcb35954108abb6f5d2454a555d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -284,7 +284,7 @@ public final class CraftServer implements Server { @@ -891,7 +906,7 @@ index 30675a23a25dc065e09d97b9b08386c9f41989d8..a12dc990a9094e964be2af26a5135e3b @Deprecated diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java -index c1023eff9f391c07b57e57450b756fe16299f723..b5e0023e431f9fb43c93a3f977144b03545322bb 100644 +index 091e11934bddb180f0b2e51efb3921c62275d41d..12fe2f8d0dcb715545e071023490a32125b9c4a4 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java +++ b/src/main/java/org/bukkit/craftbukkit/legacy/FieldRename.java @@ -51,11 +51,14 @@ public class FieldRename { @@ -915,10 +930,10 @@ index c1023eff9f391c07b57e57450b756fe16299f723..b5e0023e431f9fb43c93a3f977144b03 // PatternType private static final FieldRenameData PATTERN_TYPE_DATA = FieldRenameData.Builder.newBuilder() diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index b85223ebff4dbb8aa74b501663afc87ef11e2a96..760f56d36f0e4a74b58628408a286a499d6664ec 100644 +index 9a6857f325d72c1b5ce403c3240e0b1a3f43bc38..e4b79d92a8c41eb37d989248425b1e5a963b476c 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -215,20 +215,10 @@ public class Commodore { +@@ -218,20 +218,10 @@ public class Commodore { public byte[] convert(byte[] b, final String pluginName, final ApiVersion pluginVersion, final Set<String> activeCompatibilities) { final boolean modern = pluginVersion.isNewerThanOrSameAs(ApiVersion.FLATTENING); @@ -939,7 +954,7 @@ index b85223ebff4dbb8aa74b501663afc87ef11e2a96..760f56d36f0e4a74b58628408a286a49 visitor = io.papermc.paper.pluginremap.reflect.ReflectionRemapper.visitor(visitor); // Paper cr.accept(new ClassRemapper(new ClassVisitor(Opcodes.ASM9, visitor) { -@@ -295,15 +285,6 @@ public class Commodore { +@@ -298,15 +288,6 @@ public class Commodore { @Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { @@ -1244,7 +1259,7 @@ index bbd5dd5b27937ddc3d8c57f2b604331495b0f311..626c3033e36897846fe84a77d05e2e91 CraftRegistry.setMinecraftRegistry(RegistryHelper.getRegistry()); } diff --git a/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java b/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java -index 47f3b79d76399ff2185ea753260a702441ecadf5..eb3974690fb12ffe678522ed47e0f730712db016 100644 +index c0e02198200c93e3d0ff2461d267e856db087532..949094070455fdc73c1dca16276e051a0a35a5e2 100644 --- a/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java +++ b/src/test/java/org/bukkit/support/provider/RegistriesArgumentProvider.java @@ -1,6 +1,7 @@ @@ -1255,12 +1270,15 @@ index 47f3b79d76399ff2185ea753260a702441ecadf5..eb3974690fb12ffe678522ed47e0f730 import java.util.List; import java.util.stream.Stream; import net.minecraft.core.registries.Registries; -@@ -61,36 +62,35 @@ public class RegistriesArgumentProvider implements ArgumentsProvider { +@@ -67,39 +68,37 @@ public class RegistriesArgumentProvider implements ArgumentsProvider { private static final List<Arguments> DATA = Lists.newArrayList(); static { - // Order: Bukkit class, Minecraft Registry key, CraftBukkit class, Minecraft class +- register(Attribute.class, Registries.ATTRIBUTE, CraftAttribute.class, net.minecraft.world.entity.ai.attributes.Attribute.class); +- register(Biome.class, Registries.BIOME, CraftBiome.class, net.minecraft.world.level.biome.Biome.class); - register(Enchantment.class, Registries.ENCHANTMENT, CraftEnchantment.class, net.minecraft.world.item.enchantment.Enchantment.class); +- register(Fluid.class, Registries.FLUID, CraftFluid.class, net.minecraft.world.level.material.Fluid.class); - register(GameEvent.class, Registries.GAME_EVENT, CraftGameEvent.class, net.minecraft.world.level.gameevent.GameEvent.class); - register(MusicInstrument.class, Registries.INSTRUMENT, CraftMusicInstrument.class, Instrument.class); - register(MenuType.class, Registries.MENU, CraftMenuType.class, net.minecraft.world.inventory.MenuType.class); @@ -1282,6 +1300,8 @@ index 47f3b79d76399ff2185ea753260a702441ecadf5..eb3974690fb12ffe678522ed47e0f730 - register(PatternType.class, Registries.BANNER_PATTERN, CraftPatternType.class, BannerPattern.class); - + // Order: RegistryKey, Bukkit class, Minecraft Registry key, CraftBukkit class, Minecraft class ++ register(RegistryKey.ATTRIBUTE, Attribute.class, Registries.ATTRIBUTE, CraftAttribute.class, net.minecraft.world.entity.ai.attributes.Attribute.class); ++ register(RegistryKey.BIOME, Biome.class, Registries.BIOME, CraftBiome.class, net.minecraft.world.level.biome.Biome.class); + register(RegistryKey.ENCHANTMENT, Enchantment.class, Registries.ENCHANTMENT, CraftEnchantment.class, net.minecraft.world.item.enchantment.Enchantment.class); + register(RegistryKey.GAME_EVENT, GameEvent.class, Registries.GAME_EVENT, CraftGameEvent.class, net.minecraft.world.level.gameevent.GameEvent.class); + register(RegistryKey.INSTRUMENT, MusicInstrument.class, Registries.INSTRUMENT, CraftMusicInstrument.class, Instrument.class); diff --git a/patches/server/0496-Expand-world-key-API.patch b/patches/server/0496-Expand-world-key-API.patch index 80f4011a34..903e7ac8ea 100644 --- a/patches/server/0496-Expand-world-key-API.patch +++ b/patches/server/0496-Expand-world-key-API.patch @@ -20,7 +20,7 @@ index 15da29058f80a2d7cf2be26c48421c1746815a10..a070b2a83edaa702b13bc6d302691412 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a12dc990a9094e964be2af26a5135e3b798f9666..85b2298efface87ee97e0f996d939cc135ca981d 100644 +index 45ddb643d544dbcb35954108abb6f5d2454a555d..aeb6568c6a48d3448c5724896898371228313ceb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1185,9 +1185,15 @@ public final class CraftServer implements Server { @@ -67,10 +67,10 @@ index a12dc990a9094e964be2af26a5135e3b798f9666..85b2298efface87ee97e0f996d939cc1 // Check if a World already exists with the UID. if (this.getWorld(world.getUID()) != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index af8fde74b3162d2de740ecae1122b4f2115baeb6..77f0d6c44c3773968b1e858d02cfc4ffb25fe99b 100644 +index e88b384e3d640dd77e419611f3c0e588fbf4f406..28948975c5adcf78d9c0e0b6fb63db981a369a77 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -527,6 +527,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -538,6 +538,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public int nextEntityId() { return net.minecraft.world.entity.Entity.nextEntityId(); } diff --git a/patches/server/0501-Expose-protocol-version.patch b/patches/server/0501-Expose-protocol-version.patch index 13133988e5..61d4fc32be 100644 --- a/patches/server/0501-Expose-protocol-version.patch +++ b/patches/server/0501-Expose-protocol-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose protocol version diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 77f0d6c44c3773968b1e858d02cfc4ffb25fe99b..ada83b5e843f761837a7510112162c6954ab4260 100644 +index 28948975c5adcf78d9c0e0b6fb63db981a369a77..25a206cf1eb07e826b549aacf9a4d0fbffb32177 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -532,6 +532,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -543,6 +543,11 @@ public final class CraftMagicNumbers implements UnsafeValues { public String getMainLevelName() { return ((net.minecraft.server.dedicated.DedicatedServer) net.minecraft.server.MinecraftServer.getServer()).getProperties().levelName; } diff --git a/patches/server/0528-ItemStack-repair-check-API.patch b/patches/server/0528-ItemStack-repair-check-API.patch index b016fcc18d..fb178f277b 100644 --- a/patches/server/0528-ItemStack-repair-check-API.patch +++ b/patches/server/0528-ItemStack-repair-check-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack repair check API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index ada83b5e843f761837a7510112162c6954ab4260..02306ed81a67faa94d98070d3e7c9044cb5d2825 100644 +index 25a206cf1eb07e826b549aacf9a4d0fbffb32177..079cb08b92061bb14952cf4ad2bda61e154f4438 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -537,6 +537,14 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -548,6 +548,14 @@ public final class CraftMagicNumbers implements UnsafeValues { public int getProtocolVersion() { return net.minecraft.SharedConstants.getCurrentVersion().getProtocolVersion(); } diff --git a/patches/server/0535-Improve-item-default-attribute-API.patch b/patches/server/0535-Improve-item-default-attribute-API.patch index 6f2c104c78..f5daf28287 100644 --- a/patches/server/0535-Improve-item-default-attribute-API.patch +++ b/patches/server/0535-Improve-item-default-attribute-API.patch @@ -62,10 +62,10 @@ index 68756419ac6ee292db9569eab380a5c14d748002..6d76cc1db3ac3f1ae74c13511937fb86 return defaultAttributes.build(); } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 02306ed81a67faa94d98070d3e7c9044cb5d2825..ffc98d8ed238cc653a7a6518a46c4e45a1b3682c 100644 +index 079cb08b92061bb14952cf4ad2bda61e154f4438..6855210dc58f455b5af05d9c039da55e8dfc93f1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -385,7 +385,11 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -386,7 +386,11 @@ public final class CraftMagicNumbers implements UnsafeValues { @Override public Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot) { diff --git a/patches/server/0580-Get-entity-default-attributes.patch b/patches/server/0580-Get-entity-default-attributes.patch index 6d512ca637..468e4b22e5 100644 --- a/patches/server/0580-Get-entity-default-attributes.patch +++ b/patches/server/0580-Get-entity-default-attributes.patch @@ -81,10 +81,10 @@ index 0000000000000000000000000000000000000000..ec9ebd2d539333293c51b7edfa18f18b + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index ffc98d8ed238cc653a7a6518a46c4e45a1b3682c..31b625779dfe27602ac198259258e64195c1796d 100644 +index 6855210dc58f455b5af05d9c039da55e8dfc93f1..1dd9a5cc45d5073adb150abdcbe2025e6ed2c315 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -549,6 +549,18 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -560,6 +560,18 @@ public final class CraftMagicNumbers implements UnsafeValues { } return CraftItemStack.unwrap(itemToBeRepaired).isValidRepairItem(CraftItemStack.unwrap(repairMaterial)); } diff --git a/patches/server/0582-Add-more-advancement-API.patch b/patches/server/0582-Add-more-advancement-API.patch index 1d8e873a36..ac526b9045 100644 --- a/patches/server/0582-Add-more-advancement-API.patch +++ b/patches/server/0582-Add-more-advancement-API.patch @@ -164,10 +164,10 @@ index 8ca86852319d7463f60832bc98b825b0b4325995..62ada73302c6b3ce3fb2dcc8c31a1d9c private final DisplayInfo handle; diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 760f56d36f0e4a74b58628408a286a499d6664ec..34e41ea24e1673109f14153a1a0c8e794fed20bb 100644 +index e4b79d92a8c41eb37d989248425b1e5a963b476c..1f25fa2b2ce8fae5bce29232cbb51966b86dae85 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -453,6 +453,11 @@ public class Commodore { +@@ -456,6 +456,11 @@ public class Commodore { super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); return; } diff --git a/patches/server/0583-Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/0583-Add-ItemFactory-getSpawnEgg-API.patch index 715b0b753d..52f7274600 100644 --- a/patches/server/0583-Add-ItemFactory-getSpawnEgg-API.patch +++ b/patches/server/0583-Add-ItemFactory-getSpawnEgg-API.patch @@ -37,10 +37,10 @@ index cab7a3d21699605cb7fc480830d7529f70e69e88..ad86ee4372e55c82968fd4fc6a65deba + // Paper end - old getSpawnEgg API } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 34e41ea24e1673109f14153a1a0c8e794fed20bb..63d4ffe93a445abf3c766d4f1f8fbf4a412a2a03 100644 +index 1f25fa2b2ce8fae5bce29232cbb51966b86dae85..f10e7a847e9f57d2a987b118215c0ceab251a5b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -460,6 +460,15 @@ public class Commodore { +@@ -463,6 +463,15 @@ public class Commodore { } // Paper end diff --git a/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch index 660fb63c77..404023dde8 100644 --- a/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0589-Add-Raw-Byte-Entity-Serialization.patch @@ -50,10 +50,10 @@ index 0c1c9033646dedcf1d11dee74d6965683adadf0a..1ed01978611cddb2558e441863dadc46 @Override public boolean isInvisible() { // Paper - moved up from LivingEntity diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 31b625779dfe27602ac198259258e64195c1796d..1ab160c3d042be43df3bd19d095534b91c4c2f71 100644 +index 1dd9a5cc45d5073adb150abdcbe2025e6ed2c315..2a3dc48aa50b41ede0e1a0e280314624961967f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -499,7 +499,33 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -510,7 +510,33 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.parse(MinecraftServer.getServer().registryAccess(), compound).orElseThrow()); } diff --git a/patches/server/0681-Cache-resource-keys-and-optimize-reference-Holder-ta.patch b/patches/server/0681-Cache-resource-keys-and-optimize-reference-Holder-ta.patch index 263f5852b3..7356aca21a 100644 --- a/patches/server/0681-Cache-resource-keys-and-optimize-reference-Holder-ta.patch +++ b/patches/server/0681-Cache-resource-keys-and-optimize-reference-Holder-ta.patch @@ -18,34 +18,6 @@ index 94671ea227b59a8f820425c401712e6aeb8b2b10..e91c4e26c25980645941ca8fbdcc3a9d } @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java -index 95b956802f83b583a823fcd24808363775a56842..33d2e89ac40465b0c4633f9c51378b80f7c397a9 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBiome.java -@@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block; - import com.google.common.base.Preconditions; - import net.minecraft.core.Holder; - import net.minecraft.core.registries.Registries; -+import net.minecraft.resources.ResourceKey; - import org.bukkit.Registry; - import org.bukkit.block.Biome; - import org.bukkit.craftbukkit.CraftRegistry; -@@ -27,13 +28,14 @@ public class CraftBiome { - return CraftBiome.minecraftToBukkit(minecraft.value()); - } - -+ private static final java.util.Map<org.bukkit.block.Biome, ResourceKey<net.minecraft.world.level.biome.Biome>> BIOME_KEY_CACHE = java.util.Collections.synchronizedMap(new java.util.EnumMap<>(Biome.class)); // Paper - public static net.minecraft.world.level.biome.Biome bukkitToMinecraft(Biome bukkit) { - if (bukkit == null || bukkit == Biome.CUSTOM) { - return null; - } - - return CraftRegistry.getMinecraftRegistry(Registries.BIOME) -- .getOptional(CraftNamespacedKey.toMinecraft(bukkit.getKey())).orElseThrow(); -+ .getOptional(BIOME_KEY_CACHE.computeIfAbsent(bukkit, b -> ResourceKey.create(Registries.BIOME, CraftNamespacedKey.toMinecraft(b.getKey())))).orElseThrow(); - } - - public static Holder<net.minecraft.world.level.biome.Biome> bukkitToMinecraftHolder(Biome bukkit) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java index 6cf8af0c85231de9955282d4abaa0607ec9a195c..d230cbc26f61d8ac5880825aca4dfab197c20401 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityType.java diff --git a/patches/server/0726-Add-NamespacedKey-biome-methods.patch b/patches/server/0726-Add-NamespacedKey-biome-methods.patch index 015b2064d9..edb6f45831 100644 --- a/patches/server/0726-Add-NamespacedKey-biome-methods.patch +++ b/patches/server/0726-Add-NamespacedKey-biome-methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add NamespacedKey biome methods Co-authored-by: Thonk <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 1ab160c3d042be43df3bd19d095534b91c4c2f71..9f4124485dac3d029ec8247b64098042aa1a48d2 100644 +index 2a3dc48aa50b41ede0e1a0e280314624961967f2..b45655e7c72bc15173fbf09599dafa05babd5bb1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -587,6 +587,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -598,6 +598,19 @@ public final class CraftMagicNumbers implements UnsafeValues { var supplier = net.minecraft.world.entity.ai.attributes.DefaultAttributes.getSupplier((net.minecraft.world.entity.EntityType<? extends net.minecraft.world.entity.LivingEntity>) net.minecraft.core.registries.BuiltInRegistries.ENTITY_TYPE.getValue(CraftNamespacedKey.toMinecraft(bukkitEntityKey))); return new io.papermc.paper.attribute.UnmodifiableAttributeMap(supplier); } diff --git a/patches/server/0735-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/0735-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch index fb6e8b07ea..62022124a8 100644 --- a/patches/server/0735-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch +++ b/patches/server/0735-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Mitigate effects of WorldCreator#keepSpawnLoaded ret type TODO: Remove in 1.21? diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 63d4ffe93a445abf3c766d4f1f8fbf4a412a2a03..419b899f0e65b9656432513b69f60150c75bd13f 100644 +index f10e7a847e9f57d2a987b118215c0ceab251a5b0..015a2cf3e969e938158f27a04e172c837068437d 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -458,6 +458,12 @@ public class Commodore { +@@ -461,6 +461,12 @@ public class Commodore { super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, runtimeCbPkgPrefix() + "advancement/CraftAdvancement", "getDisplay0", desc, false); return; } diff --git a/patches/server/0845-Fix-custom-statistic-criteria-creation.patch b/patches/server/0845-Fix-custom-statistic-criteria-creation.patch index c57ac96255..92862d81f1 100644 --- a/patches/server/0845-Fix-custom-statistic-criteria-creation.patch +++ b/patches/server/0845-Fix-custom-statistic-criteria-creation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix custom statistic criteria creation diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 9f4124485dac3d029ec8247b64098042aa1a48d2..a74784ddf63d316f253381ed803822a149e92bc7 100644 +index b45655e7c72bc15173fbf09599dafa05babd5bb1..f15060bbe6dc0fbb4a81aee294d311047a3650b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -600,6 +600,12 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -611,6 +611,12 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> biomeBase = cra.getHandle().registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME).getOrThrow(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.BIOME, org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(biomeKey))); cra.setBiome(x, y, z, biomeBase); } diff --git a/patches/server/0883-Fix-UnsafeValues-loadAdvancement.patch b/patches/server/0883-Fix-UnsafeValues-loadAdvancement.patch index dc4c28926e..1fa31034dc 100644 --- a/patches/server/0883-Fix-UnsafeValues-loadAdvancement.patch +++ b/patches/server/0883-Fix-UnsafeValues-loadAdvancement.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix UnsafeValues#loadAdvancement diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index a74784ddf63d316f253381ed803822a149e92bc7..1835f8cfda0222fadd9db31abfb7e85899051853 100644 +index f15060bbe6dc0fbb4a81aee294d311047a3650b2..86c78365e7510140515b0f0f834113d01095b842 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -302,9 +302,30 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -303,9 +303,30 @@ public final class CraftMagicNumbers implements UnsafeValues { ResourceLocation minecraftkey = CraftNamespacedKey.toMinecraft(key); JsonElement jsonelement = JsonParser.parseString(advancement); diff --git a/patches/server/0905-Improve-Registry.patch b/patches/server/0905-Improve-Registry.patch index d5769f63c0..7bd4b1163b 100644 --- a/patches/server/0905-Improve-Registry.patch +++ b/patches/server/0905-Improve-Registry.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Improve Registry diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index 09929f580164abcd1c04061d04c6aa992767e256..aa66fd8dca886c1f064d8cb4a3d15c2086c1719a 100644 +index 16985dc1f54d64c44f96b045012612f16ba9ae8a..002a3475c6e062071845399ed723754ce4ce9e95 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -155,6 +155,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -150,6 +150,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { private final Class<?> bukkitClass; // Paper - relax preload class private final Map<NamespacedKey, B> cache = new HashMap<>(); @@ -16,7 +16,7 @@ index 09929f580164abcd1c04061d04c6aa992767e256..aa66fd8dca886c1f064d8cb4a3d15c20 private final net.minecraft.core.Registry<M> minecraftRegistry; private final BiFunction<NamespacedKey, M, B> minecraftToBukkit; private final BiFunction<NamespacedKey, ApiVersion, NamespacedKey> serializationUpdater; // Paper - rename to make it *clear* what it is *only* for -@@ -203,6 +204,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -198,6 +199,7 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { } this.cache.put(namespacedKey, bukkit); @@ -24,7 +24,7 @@ index 09929f580164abcd1c04061d04c6aa992767e256..aa66fd8dca886c1f064d8cb4a3d15c20 return bukkit; } -@@ -235,4 +237,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -230,4 +232,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { return this.minecraftToBukkit.apply(namespacedKey, minecraft); } diff --git a/patches/server/0912-Fixup-NamespacedKey-handling.patch b/patches/server/0912-Fixup-NamespacedKey-handling.patch index 932cc370d8..0eee21b8d0 100644 --- a/patches/server/0912-Fixup-NamespacedKey-handling.patch +++ b/patches/server/0912-Fixup-NamespacedKey-handling.patch @@ -18,10 +18,10 @@ index 90b82ad996b2b85628c9a5ddeef9410150b7f70c..5fd22a80e9d05afbea273471cee99173 public static NamespacedKey minecraftToBukkitKey(ResourceKey<LootTable> minecraft) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index aa66fd8dca886c1f064d8cb4a3d15c2086c1719a..f8450a2abd1e96fac7827d252cc00038b9dee839 100644 +index 002a3475c6e062071845399ed723754ce4ce9e95..9245f6de141384bfc12e8dd81ce1df366c6a62aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -122,6 +122,16 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -125,6 +125,16 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { + ", this can happen if a plugin creates its own registry entry with out properly registering it."); } @@ -39,10 +39,10 @@ index aa66fd8dca886c1f064d8cb4a3d15c2086c1719a..f8450a2abd1e96fac7827d252cc00038 // Paper - NOTE: As long as all uses of the method below relate to *serialization* via ConfigurationSerializable, it's fine diff --git a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java -index cc97638e038ea64ad180ebfded2528aa07d1809e..10e4318782107644f67818109784fff60d017e0a 100644 +index 9ab615347e241ac264fb70f43306075907420885..0d04f0a34d1d1894845b720a407f7190ea78d514 100644 --- a/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java +++ b/src/main/java/org/bukkit/craftbukkit/attribute/CraftAttribute.java -@@ -37,6 +37,7 @@ public class CraftAttribute { +@@ -33,6 +33,7 @@ public class CraftAttribute implements Attribute, Handleable<net.minecraft.world string = FieldRename.convertAttributeName(ApiVersion.CURRENT, string); string = string.toLowerCase(Locale.ROOT); NamespacedKey key = NamespacedKey.fromString(string); diff --git a/patches/server/0917-Add-api-for-spawn-egg-texture-colors.patch b/patches/server/0917-Add-api-for-spawn-egg-texture-colors.patch index af708be49f..4e62776b84 100644 --- a/patches/server/0917-Add-api-for-spawn-egg-texture-colors.patch +++ b/patches/server/0917-Add-api-for-spawn-egg-texture-colors.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add api for spawn egg texture colors diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 1835f8cfda0222fadd9db31abfb7e85899051853..30106a999db1bae217333b5e94913b9ec55e4615 100644 +index 86c78365e7510140515b0f0f834113d01095b842..406459fb842f3dca6f303547c041c6c7cfbdc3d0 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -629,6 +629,15 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -640,6 +640,15 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end diff --git a/patches/server/0918-Add-Lifecycle-Event-system.patch b/patches/server/0918-Add-Lifecycle-Event-system.patch index 0eaff54d34..705dd8b637 100644 --- a/patches/server/0918-Add-Lifecycle-Event-system.patch +++ b/patches/server/0918-Add-Lifecycle-Event-system.patch @@ -727,7 +727,7 @@ index 2e96308696e131f3f013469a395e5ddda2c5d529..65a66e484c1c39c5f41d97db52f31c67 } catch (Throwable e) { LOGGER.error("Failed to run bootstrapper for %s. This plugin will not be loaded.".formatted(provider.getSource()), e); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a1f2c8fd0348a6a5dad521430f473867bdadd1a5..a2c749b2997557fec5c978f3bed8c35d7614e740 100644 +index 9ab601a8e455196cd04dfa0fa81c4d356ec62b13..5112fdb9faf4b2761bb2b7107c49952f37be030c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1050,6 +1050,11 @@ public final class CraftServer implements Server { @@ -743,10 +743,10 @@ index a1f2c8fd0348a6a5dad521430f473867bdadd1a5..a2c749b2997557fec5c978f3bed8c35d this.reloadCount++; this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 30106a999db1bae217333b5e94913b9ec55e4615..06d66c8043daec3c736d82d972ceb98d55eae9d1 100644 +index 406459fb842f3dca6f303547c041c6c7cfbdc3d0..457bde1fbf8904d193aee15ec4dea3891ecfb451 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -638,6 +638,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -649,6 +649,13 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - spawn egg color visibility diff --git a/patches/server/0919-ItemStack-Tooltip-API.patch b/patches/server/0919-ItemStack-Tooltip-API.patch index f06c4356cd..992e3acfcc 100644 --- a/patches/server/0919-ItemStack-Tooltip-API.patch +++ b/patches/server/0919-ItemStack-Tooltip-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ItemStack Tooltip API diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 06d66c8043daec3c736d82d972ceb98d55eae9d1..51d5629b00ec4929c12ed9e6ba5a37f5903cf13e 100644 +index 457bde1fbf8904d193aee15ec4dea3891ecfb451..61837051eb67709bf671b94c02e23bdb6eae6711 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -627,6 +627,19 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -638,6 +638,19 @@ public final class CraftMagicNumbers implements UnsafeValues { if (statistic.getType() != org.bukkit.Statistic.Type.UNTYPED) return "minecraft.custom:minecraft." + statistic.getKey().getKey(); return org.bukkit.craftbukkit.CraftStatistic.getNMSStatistic(statistic).getName(); } diff --git a/patches/server/0936-Fix-possible-StackOverflowError-and-NPE-for-some-dis.patch b/patches/server/0936-Fix-possible-StackOverflowError-and-NPE-for-some-dis.patch index 25ace4aa41..2041bbd5a1 100644 --- a/patches/server/0936-Fix-possible-StackOverflowError-and-NPE-for-some-dis.patch +++ b/patches/server/0936-Fix-possible-StackOverflowError-and-NPE-for-some-dis.patch @@ -236,10 +236,10 @@ index f2e19218cf0d3b44a617c7d74f782c3e15e3f07f..aae9ec8f3bd39685b37251bef3f9ac84 idispensebehavior.dispense(pointer, eventStack); return stack; diff --git a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java -index a9d230d6ff22d5e3a11b2f31e7d751f44888a12c..aba0ddfc5009a11b6c5cba95a90479083643bdad 100644 +index 6b343afe473624082e13bee935638eb140271184..baf3feee740c816cf9f0470a8e56a36d02c9a29c 100644 --- a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java -@@ -57,7 +57,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior { +@@ -56,7 +56,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior { stack.grow(1); // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); @@ -292,7 +292,7 @@ index a02f24448b002824b068278fa427003008c0d0f1..500c56c4ef0878434582a50d6dba2ccc if (!stack.isItemEnabled(world.enabledFeatures())) { return DispenserBlock.DEFAULT_BEHAVIOR; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 96b901d07718d8926a2175925e867b4417c3947c..418e67ef5896325fe143501f5a4f1604b065ba0f 100644 +index 937ed4e77739ff02ff1e4405047f15eac40906fe..41a0650bfd6e72b83364441dd76df3d561d3163e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -2232,7 +2232,7 @@ public class CraftEventFactory { diff --git a/patches/server/0940-Properly-track-the-changed-item-from-dispense-events.patch b/patches/server/0940-Properly-track-the-changed-item-from-dispense-events.patch index 872400fdee..7b03ec7aef 100644 --- a/patches/server/0940-Properly-track-the-changed-item-from-dispense-events.patch +++ b/patches/server/0940-Properly-track-the-changed-item-from-dispense-events.patch @@ -72,18 +72,18 @@ index 681c38f4457fc10806c10518b16159580c0f2619..8f9b86e50717746e55232293d9e5ac05 } else { return this.defaultDispenseItemBehavior.dispense(pointer, stack); diff --git a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java -index aba0ddfc5009a11b6c5cba95a90479083643bdad..b341792b694e4d6d7ca98061976b8857d83c4233 100644 +index baf3feee740c816cf9f0470a8e56a36d02c9a29c..281439e430fb8e587549da783bdd93432f8f957f 100644 --- a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java -@@ -64,7 +64,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior { - } - } +@@ -65,7 +65,7 @@ public class ProjectileDispenseBehavior extends DefaultDispenseItemBehavior { -- Projectile iprojectile = Projectile.spawnProjectileUsingShoot(this.projectileItem.asProjectile(worldserver, iposition, stack, enumdirection), worldserver, stack, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), this.dispenseConfig.power(), this.dispenseConfig.uncertainty()); -+ Projectile iprojectile = Projectile.spawnProjectileUsingShoot(this.projectileItem.asProjectile(worldserver, iposition, CraftItemStack.unwrap(event.getItem()), enumdirection), worldserver, stack, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), this.dispenseConfig.power(), this.dispenseConfig.uncertainty()); // Paper - track changed items in the dispense event; unwrap is safe here because all uses of the stack make their own copies - ((Entity) iprojectile).projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity()); + // SPIGOT-7923: Avoid create projectiles with empty item + if (!itemstack1.isEmpty()) { +- Projectile iprojectile = Projectile.spawnProjectileUsingShoot(this.projectileItem.asProjectile(worldserver, iposition, itemstack1, enumdirection), worldserver, itemstack1, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), this.dispenseConfig.power(), this.dispenseConfig.uncertainty()); ++ Projectile iprojectile = Projectile.spawnProjectileUsingShoot(this.projectileItem.asProjectile(worldserver, iposition, CraftItemStack.unwrap(event.getItem()), enumdirection), worldserver, itemstack1, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), this.dispenseConfig.power(), this.dispenseConfig.uncertainty()); // Paper - track changed items in the dispense event; unwrap is safe here because all uses of the stack make their own copies + iprojectile.projectileSource = new org.bukkit.craftbukkit.projectiles.CraftBlockProjectileSource(pointer.blockEntity()); + } // itemstack.shrink(1); // CraftBukkit - Handled during event processing - // CraftBukkit end diff --git a/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java index cc85e96035f7cb2e6493b1cc4748031171d7dbee..16b435216dc7c6a3f8c1c0f9e2323e6afb3a6cb9 100644 --- a/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java diff --git a/patches/server/0953-General-ItemMeta-fixes.patch b/patches/server/0953-General-ItemMeta-fixes.patch index 9421f612dd..54c99087b9 100644 --- a/patches/server/0953-General-ItemMeta-fixes.patch +++ b/patches/server/0953-General-ItemMeta-fixes.patch @@ -1049,7 +1049,7 @@ index 566d893a413fd04b99e83dc2da8fe958a48492a8..a944803771d514572f94b4e98a6d4435 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 13b19adc21ece31476b2980c5bc01a50f15df634..a6e2281bfac94f1e19836d9c8415d8270387b16d 100644 +index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec532cc0d9ba 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -199,9 +199,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @@ -1194,15 +1194,6 @@ index 13b19adc21ece31476b2980c5bc01a50f15df634..a6e2281bfac94f1e19836d9c8415d827 } @Override -@@ -1656,7 +1664,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { - - @Override - public void setEquippable(EquippableComponent equippable) { -- this.equippable = (equippable == null) ? null : new CraftEquippableComponent((CraftEquippableComponent) this.equippable); -+ this.equippable = (equippable == null) ? null : new CraftEquippableComponent((CraftEquippableComponent) equippable); // Paper - } - - @Override @@ -1692,7 +1700,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Override diff --git a/patches/server/0993-Registry-Modification-API.patch b/patches/server/0993-Registry-Modification-API.patch index 13cda87ccc..166ad90f90 100644 --- a/patches/server/0993-Registry-Modification-API.patch +++ b/patches/server/0993-Registry-Modification-API.patch @@ -9,7 +9,7 @@ public net.minecraft.resources.RegistryOps lookupProvider public net.minecraft.resources.RegistryOps$HolderLookupAdapter diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java -index 633b01431750d4b40159a57bf25fb35c6670ff1b..5cf598905ed6a7ac2b0d9ced3420adaf20ceb6af 100644 +index 24a763b2ae635f19032696bb1feeb3b3aa72f0fd..9c7f03abda5175b837ed8592a91ec0cab28f28df 100644 --- a/src/main/java/io/papermc/paper/registry/PaperRegistries.java +++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java @@ -2,6 +2,7 @@ package io.papermc.paper.registry; @@ -20,7 +20,7 @@ index 633b01431750d4b40159a57bf25fb35c6670ff1b..5cf598905ed6a7ac2b0d9ced3420adaf import java.util.Collections; import java.util.IdentityHashMap; import java.util.List; -@@ -58,6 +59,7 @@ import org.checkerframework.framework.qual.DefaultQualifier; +@@ -62,6 +63,7 @@ import org.checkerframework.framework.qual.DefaultQualifier; import static io.papermc.paper.registry.entry.RegistryEntry.apiOnly; import static io.papermc.paper.registry.entry.RegistryEntry.entry; @@ -28,7 +28,7 @@ index 633b01431750d4b40159a57bf25fb35c6670ff1b..5cf598905ed6a7ac2b0d9ced3420adaf @DefaultQualifier(NonNull.class) public final class PaperRegistries { -@@ -141,6 +143,15 @@ public final class PaperRegistries { +@@ -147,6 +149,15 @@ public final class PaperRegistries { return ResourceKey.create((ResourceKey<? extends Registry<M>>) PaperRegistries.registryToNms(typedKey.registryKey()), PaperAdventure.asVanilla(typedKey.key())); } @@ -1323,10 +1323,10 @@ index 6fddef967b6314ca0158f5bd4b8898670ea5e9ec..b5ca1a0acb16d0cd8dccc854f309d425 return writableRegistry; }, prepareExecutor); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -index f8450a2abd1e96fac7827d252cc00038b9dee839..891ccc39d52331648a11b4e7cce78d4c848cdea0 100644 +index 9245f6de141384bfc12e8dd81ce1df366c6a62aa..d97ddbcb5efdae5f848c77bee52058b16316b3dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java -@@ -167,11 +167,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -162,11 +162,11 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { private final Map<NamespacedKey, B> cache = new HashMap<>(); private final Map<B, NamespacedKey> byValue = new java.util.IdentityHashMap<>(); // Paper - improve Registry private final net.minecraft.core.Registry<M> minecraftRegistry; @@ -1340,7 +1340,7 @@ index f8450a2abd1e96fac7827d252cc00038b9dee839..891ccc39d52331648a11b4e7cce78d4c this.bukkitClass = bukkitClass; this.minecraftRegistry = minecraftRegistry; this.minecraftToBukkit = minecraftToBukkit; -@@ -254,4 +254,17 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { +@@ -249,4 +249,17 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> { return this.byValue.get(value); } // Paper end - improve Registry @@ -1359,10 +1359,10 @@ index f8450a2abd1e96fac7827d252cc00038b9dee839..891ccc39d52331648a11b4e7cce78d4c + // Paper end - RegistrySet API } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 51d5629b00ec4929c12ed9e6ba5a37f5903cf13e..d728bf1d83877290e4d3fdaa7649ed077c0ee1ec 100644 +index 61837051eb67709bf671b94c02e23bdb6eae6711..be4c52dc4d7b5d42d6f408c386fb838c1d8c35c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -658,6 +658,21 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -669,6 +669,21 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - lifecycle event API diff --git a/patches/server/0994-Add-registry-entry-and-builders.patch b/patches/server/0994-Add-registry-entry-and-builders.patch index 0355a6b299..8edd2ba956 100644 --- a/patches/server/0994-Add-registry-entry-and-builders.patch +++ b/patches/server/0994-Add-registry-entry-and-builders.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add registry entry and builders diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java -index 5cf598905ed6a7ac2b0d9ced3420adaf20ceb6af..12220f78ffaf06433ada72fd0c7f22b97d55287d 100644 +index 9c7f03abda5175b837ed8592a91ec0cab28f28df..8000eaccc9bf60702feabde71d09db04e26106e8 100644 --- a/src/main/java/io/papermc/paper/registry/PaperRegistries.java +++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java @@ -1,6 +1,8 @@ @@ -17,7 +17,7 @@ index 5cf598905ed6a7ac2b0d9ced3420adaf20ceb6af..12220f78ffaf06433ada72fd0c7f22b9 import io.papermc.paper.registry.entry.RegistryEntry; import io.papermc.paper.registry.tag.TagKey; import java.util.Collections; -@@ -70,7 +72,7 @@ public final class PaperRegistries { +@@ -74,7 +76,7 @@ public final class PaperRegistries { static { REGISTRY_ENTRIES = List.of( // built-ins @@ -26,7 +26,7 @@ index 5cf598905ed6a7ac2b0d9ced3420adaf20ceb6af..12220f78ffaf06433ada72fd0c7f22b9 entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new), entry(Registries.INSTRUMENT, RegistryKey.INSTRUMENT, MusicInstrument.class, CraftMusicInstrument::new), entry(Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, PotionEffectType.class, CraftPotionEffectType::new), -@@ -89,7 +91,7 @@ public final class PaperRegistries { +@@ -94,7 +96,7 @@ public final class PaperRegistries { entry(Registries.TRIM_PATTERN, RegistryKey.TRIM_PATTERN, TrimPattern.class, CraftTrimPattern::new).delayed(), entry(Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE, DamageType.class, CraftDamageType::new).delayed(), entry(Registries.WOLF_VARIANT, RegistryKey.WOLF_VARIANT, Wolf.Variant.class, CraftWolf.CraftVariant::new).delayed(), @@ -34,7 +34,7 @@ index 5cf598905ed6a7ac2b0d9ced3420adaf20ceb6af..12220f78ffaf06433ada72fd0c7f22b9 + writable(Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, Enchantment.class, CraftEnchantment::new, PaperEnchantmentRegistryEntry.PaperBuilder::new).withSerializationUpdater(FieldRename.ENCHANTMENT_RENAME).delayed(), entry(Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, JukeboxSong.class, CraftJukeboxSong::new).delayed(), entry(Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, PatternType.class, CraftPatternType::new).delayed(), - + entry(Registries.BIOME, RegistryKey.BIOME, Biome.class, CraftBiome::new).delayed(), diff --git a/src/main/java/io/papermc/paper/registry/data/PaperEnchantmentRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/PaperEnchantmentRegistryEntry.java new file mode 100644 index 0000000000000000000000000000000000000000..481f5f0cfae1fada3bc3f873fb7e04c3086ea9bf diff --git a/patches/server/0995-Proxy-ItemStack-to-CraftItemStack.patch b/patches/server/0995-Proxy-ItemStack-to-CraftItemStack.patch index 40da32a4fb..8172ef1a2e 100644 --- a/patches/server/0995-Proxy-ItemStack-to-CraftItemStack.patch +++ b/patches/server/0995-Proxy-ItemStack-to-CraftItemStack.patch @@ -205,10 +205,10 @@ index 6cc9d7a9e6d4bfdc27e52fc581b2bb832616f121..6930d0afb230a88aa813b02e4d55c95d + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index d728bf1d83877290e4d3fdaa7649ed077c0ee1ec..d3759c1262a5ce8ff82215a99abd31f20af95fc5 100644 +index be4c52dc4d7b5d42d6f408c386fb838c1d8c35c4..3bd77074da98bcfe3677995038642c4e9cdb86b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -673,6 +673,13 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -684,6 +684,13 @@ public final class CraftMagicNumbers implements UnsafeValues { } // Paper end - hack to get tags for non server-backed registries diff --git a/patches/server/1020-Add-FeatureFlag-API.patch b/patches/server/1020-Add-FeatureFlag-API.patch index eaaa35ce83..e28ac2d6db 100644 --- a/patches/server/1020-Add-FeatureFlag-API.patch +++ b/patches/server/1020-Add-FeatureFlag-API.patch @@ -284,20 +284,20 @@ index 6cf790c9fa23ea313423fdaeb7c181bf530828c6..0bcb9df1103050441f8922a688b163dc public static PotionEffectType minecraftHolderToBukkit(Holder<MobEffect> minecraft) { return CraftPotionEffectType.minecraftToBukkit(minecraft.value()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index d3759c1262a5ce8ff82215a99abd31f20af95fc5..15bb55f0b4c60b0519918b910398a0908022128f 100644 +index 3bd77074da98bcfe3677995038642c4e9cdb86b8..83835e41034e79442177f19dcb18e7df5b0e296e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -47,7 +47,7 @@ import org.bukkit.advancement.Advancement; - import org.bukkit.attribute.Attribute; +@@ -48,7 +48,7 @@ import org.bukkit.attribute.Attribute; import org.bukkit.attribute.AttributeModifier; + import org.bukkit.block.Biome; import org.bukkit.block.data.BlockData; -import org.bukkit.craftbukkit.CraftFeatureFlag; +// import org.bukkit.craftbukkit.CraftFeatureFlag; // Paper import org.bukkit.craftbukkit.CraftRegistry; import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.craftbukkit.attribute.CraftAttribute; -@@ -455,11 +455,7 @@ public final class CraftMagicNumbers implements UnsafeValues { - return CraftAttribute.bukkitToMinecraft(attribute).getDescriptionId(); + import org.bukkit.craftbukkit.block.CraftBiome; +@@ -456,11 +456,7 @@ public final class CraftMagicNumbers implements UnsafeValues { + return attribute.getTranslationKey(); } - @Override diff --git a/patches/server/1022-Item-serialization-as-json.patch b/patches/server/1022-Item-serialization-as-json.patch index 6b8500a0d7..4cc5284169 100644 --- a/patches/server/1022-Item-serialization-as-json.patch +++ b/patches/server/1022-Item-serialization-as-json.patch @@ -28,10 +28,10 @@ index c80fd4960dfbb0fde37363e7df25b0a5411bdb11..ff7f6916f65466c25a7bde35d64682c1 public static final Codec<CustomData> CODEC_WITH_ID = CODEC.validate( component -> component.getUnsafe().contains("id", 8) ? DataResult.success(component) : DataResult.error(() -> "Missing id for entity in: " + component) diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 15bb55f0b4c60b0519918b910398a0908022128f..ef0ef0872a44eb34fe41358728f3ddcf262297e9 100644 +index 83835e41034e79442177f19dcb18e7df5b0e296e..08d48cd55cfaf92530cc900f2f119ae3a258eb39 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -516,6 +516,39 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -527,6 +527,39 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.parse(MinecraftServer.getServer().registryAccess(), compound).orElseThrow()); } diff --git a/patches/server/1037-Rewrite-dataconverter-system.patch b/patches/server/1037-Rewrite-dataconverter-system.patch index e91a834827..e452b9f771 100644 --- a/patches/server/1037-Rewrite-dataconverter-system.patch +++ b/patches/server/1037-Rewrite-dataconverter-system.patch @@ -30384,10 +30384,10 @@ index b54a3741cd3ba615c83c98985cb4b3c4c586ed7a..b148cf247acdd36f856d0495cde4cc5a return nbttagcompound; }); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index ef0ef0872a44eb34fe41358728f3ddcf262297e9..05a62b2cf9ca8e0141274bd7f44ef8fb703466d1 100644 +index 08d48cd55cfaf92530cc900f2f119ae3a258eb39..d8d04183fd8bb0bcf2f703ef65b11dbd342473ba 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -@@ -512,7 +512,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -523,7 +523,7 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.nbt.CompoundTag compound = deserializeNbtFromBytes(data); final int dataVersion = compound.getInt("DataVersion"); @@ -30396,7 +30396,7 @@ index ef0ef0872a44eb34fe41358728f3ddcf262297e9..05a62b2cf9ca8e0141274bd7f44ef8fb return CraftItemStack.asCraftMirror(net.minecraft.world.item.ItemStack.parse(MinecraftServer.getServer().registryAccess(), compound).orElseThrow()); } -@@ -566,7 +566,7 @@ public final class CraftMagicNumbers implements UnsafeValues { +@@ -577,7 +577,7 @@ public final class CraftMagicNumbers implements UnsafeValues { net.minecraft.nbt.CompoundTag compound = deserializeNbtFromBytes(data); int dataVersion = compound.getInt("DataVersion"); |