From 71ae391eb3adc9a2e03514cd8bbff93d2241590c Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Wed, 24 Apr 2024 22:05:42 +0200 Subject: [PATCH] more work (721) --- .../0695-Custom-Potion-Mixes.patch} | 163 ++++++++++-------- ...96-Force-close-world-loading-screen.patch} | 10 +- ...697-Fix-falling-block-spawn-methods.patch} | 14 +- ...Expose-furnace-minecart-push-values.patch} | 0 ...ojectileHitEvent-for-piercing-arrow.patch} | 17 +- .../0700-More-Projectile-API.patch} | 78 +++------ ...x-swamp-hut-cat-generation-deadlock.patch} | 29 ++-- ...le-movement-from-players-while-tele.patch} | 4 +- ...0703-Implement-getComputedBiome-API.patch} | 4 +- .../0704-Make-some-itemstacks-nonnull.patch} | 0 ...705-Implement-enchantWithLevels-API.patch} | 4 +- .../0706-Fix-saving-in-unloadWorld.patch} | 4 +- .../0707-Buffer-OOB-setBlock-calls.patch} | 17 +- .../0708-Add-TameableDeathMessageEvent.patch} | 4 +- ...ock-data-for-EntityChangeBlockEvent.patch} | 60 +++---- ...bles-running-when-mob-loot-gamerule.patch} | 4 +- ...ssenger-world-matches-ridden-entity.patch} | 4 +- .../0712-cache-resource-keys.patch} | 0 ...low-changing-the-EnderDragon-podium.patch} | 10 +- ...erriding-a-block-entity-during-worl.patch} | 2 +- ...t-tile-entity-copies-loading-chunks.patch} | 8 +- ...ead-of-display-name-in-PlayerList-g.patch} | 4 +- .../0717-Expand-PlayerItemDamageEvent.patch} | 4 +- .../0718-WorldCreator-keepSpawnLoaded.patch | 25 +++ ...-in-CraftPersistentDataTypeRegistry.patch} | 0 ...destroyed-trigger-in-the-correct-pl.patch} | 8 +- ...Event-and-CollarColorable-interface.patch} | 20 +-- .../0745-WorldCreator-keepSpawnLoaded.patch | 27 --- 28 files changed, 263 insertions(+), 261 deletions(-) rename patches/{unapplied/server/0722-Custom-Potion-Mixes.patch => server/0695-Custom-Potion-Mixes.patch} (60%) rename patches/{unapplied/server/0723-Force-close-world-loading-screen.patch => server/0696-Force-close-world-loading-screen.patch} (87%) rename patches/{unapplied/server/0724-Fix-falling-block-spawn-methods.patch => server/0697-Fix-falling-block-spawn-methods.patch} (81%) rename patches/{unapplied/server/0725-Expose-furnace-minecart-push-values.patch => server/0698-Expose-furnace-minecart-push-values.patch} (100%) rename patches/{unapplied/server/0726-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch => server/0699-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch} (81%) rename patches/{unapplied/server/0727-More-Projectile-API.patch => server/0700-More-Projectile-API.patch} (88%) rename patches/{unapplied/server/0728-Fix-swamp-hut-cat-generation-deadlock.patch => server/0701-Fix-swamp-hut-cat-generation-deadlock.patch} (71%) rename patches/{unapplied/server/0729-Don-t-allow-vehicle-movement-from-players-while-tele.patch => server/0702-Don-t-allow-vehicle-movement-from-players-while-tele.patch} (90%) rename patches/{unapplied/server/0730-Implement-getComputedBiome-API.patch => server/0703-Implement-getComputedBiome-API.patch} (93%) rename patches/{unapplied/server/0731-Make-some-itemstacks-nonnull.patch => server/0704-Make-some-itemstacks-nonnull.patch} (100%) rename patches/{unapplied/server/0732-Implement-enchantWithLevels-API.patch => server/0705-Implement-enchantWithLevels-API.patch} (92%) rename patches/{unapplied/server/0733-Fix-saving-in-unloadWorld.patch => server/0706-Fix-saving-in-unloadWorld.patch} (83%) rename patches/{unapplied/server/0734-Buffer-OOB-setBlock-calls.patch => server/0707-Buffer-OOB-setBlock-calls.patch} (58%) rename patches/{unapplied/server/0735-Add-TameableDeathMessageEvent.patch => server/0708-Add-TameableDeathMessageEvent.patch} (90%) rename patches/{unapplied/server/0736-Fix-new-block-data-for-EntityChangeBlockEvent.patch => server/0709-Fix-new-block-data-for-EntityChangeBlockEvent.patch} (85%) rename patches/{unapplied/server/0737-fix-player-loottables-running-when-mob-loot-gamerule.patch => server/0710-fix-player-loottables-running-when-mob-loot-gamerule.patch} (88%) rename patches/{unapplied/server/0738-Ensure-entity-passenger-world-matches-ridden-entity.patch => server/0711-Ensure-entity-passenger-world-matches-ridden-entity.patch} (81%) rename patches/{unapplied/server/0739-cache-resource-keys.patch => server/0712-cache-resource-keys.patch} (100%) rename patches/{unapplied/server/0740-Allow-changing-the-EnderDragon-podium.patch => server/0713-Allow-changing-the-EnderDragon-podium.patch} (96%) rename patches/{unapplied/server/0741-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch => server/0714-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch} (96%) rename patches/{unapplied/server/0742-Prevent-tile-entity-copies-loading-chunks.patch => server/0715-Prevent-tile-entity-copies-loading-chunks.patch} (82%) rename patches/{unapplied/server/0743-Use-username-instead-of-display-name-in-PlayerList-g.patch => server/0716-Use-username-instead-of-display-name-in-PlayerList-g.patch} (87%) rename patches/{unapplied/server/0744-Expand-PlayerItemDamageEvent.patch => server/0717-Expand-PlayerItemDamageEvent.patch} (88%) create mode 100644 patches/server/0718-WorldCreator-keepSpawnLoaded.patch rename patches/{unapplied/server/0746-Fix-CME-in-CraftPersistentDataTypeRegistry.patch => server/0719-Fix-CME-in-CraftPersistentDataTypeRegistry.patch} (100%) rename patches/{unapplied/server/0747-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch => server/0720-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch} (91%) rename patches/{unapplied/server/0748-Add-EntityDyeEvent-and-CollarColorable-interface.patch => server/0721-Add-EntityDyeEvent-and-CollarColorable-interface.patch} (75%) delete mode 100644 patches/unapplied/server/0745-WorldCreator-keepSpawnLoaded.patch diff --git a/patches/unapplied/server/0722-Custom-Potion-Mixes.patch b/patches/server/0695-Custom-Potion-Mixes.patch similarity index 60% rename from patches/unapplied/server/0722-Custom-Potion-Mixes.patch rename to patches/server/0695-Custom-Potion-Mixes.patch index 2bd3d14af3..71021d8421 100644 --- a/patches/unapplied/server/0722-Custom-Potion-Mixes.patch +++ b/patches/server/0695-Custom-Potion-Mixes.patch @@ -32,22 +32,22 @@ index 0000000000000000000000000000000000000000..7ea357ac2f3a93db4ebdf24b5072be7d + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 041ba5fd85748b3183e12e7a8e10fca77eb35bf5..88821acddee03c30c2630d3d6c39cc93702ed35b 100644 +index ea442883eda28e5673cef9470145d5c40ac66159..79f7e0fb2f1aa6af441c6e09d2c443d7d4bb47ef 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2081,6 +2081,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> POTION_MIXES = Lists.newArrayList(); - private static final List> CONTAINER_MIXES = Lists.newArrayList(); +@@ -19,6 +19,7 @@ public class PotionBrewing { + private final List containers; + private final List> potionMixes; + private final List> containerMixes; + private static final it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap CUSTOM_MIXES = new it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<>(); // Paper - Custom Potion Mixes - private static final List ALLOWED_CONTAINERS = Lists.newArrayList(); - private static final Predicate ALLOWED_CONTAINER = stack -> { - for (Ingredient ingredient : ALLOWED_CONTAINERS) { -@@ -26,7 +27,7 @@ public class PotionBrewing { - }; - public static boolean isIngredient(ItemStack stack) { -- return isContainerIngredient(stack) || isPotionIngredient(stack); -+ return isContainerIngredient(stack) || isPotionIngredient(stack) || isCustomIngredient(stack); // Paper - Custom Potion Mixes + PotionBrewing(List potionTypes, List> potionRecipes, List> itemRecipes) { + this.containers = potionTypes; +@@ -27,7 +28,7 @@ public class PotionBrewing { } - protected static boolean isContainerIngredient(ItemStack stack) { -@@ -60,6 +61,11 @@ public class PotionBrewing { + public boolean isIngredient(ItemStack stack) { +- return this.isContainerIngredient(stack) || this.isPotionIngredient(stack); ++ return this.isContainerIngredient(stack) || this.isPotionIngredient(stack) || isCustomIngredient(stack); // Paper - Custom Potion Mixes } - public static boolean hasMix(ItemStack input, ItemStack ingredient) { + private boolean isContainer(ItemStack stack) { +@@ -71,6 +72,11 @@ public class PotionBrewing { + } + + public boolean hasMix(ItemStack input, ItemStack ingredient) { + // Paper start - Custom Potion Mixes + if (hasCustomMix(input, ingredient)) { + return true; + } + // Paper end - Custom Potion Mixes - return ALLOWED_CONTAINER.test(input) && (hasContainerMix(input, ingredient) || hasPotionMix(input, ingredient)); + return this.isContainer(input) && (this.hasContainerMix(input, ingredient) || this.hasPotionMix(input, ingredient)); } -@@ -89,6 +95,13 @@ public class PotionBrewing { - - public static ItemStack mix(ItemStack ingredient, ItemStack input) { - if (!input.isEmpty()) { -+ // Paper start - Custom Potion Mixes -+ for (var mix : CUSTOM_MIXES.values()) { -+ if (mix.input().test(input) && mix.ingredient().test(ingredient)) { -+ return mix.result().copy(); +@@ -107,6 +113,13 @@ public class PotionBrewing { + if (optional.isEmpty()) { + return input; + } else { ++ // Paper start - Custom Potion Mixes ++ for (var mix : CUSTOM_MIXES.values()) { ++ if (mix.input().test(input) && mix.ingredient().test(ingredient)) { ++ return mix.result().copy(); ++ } + } -+ } -+ // Paper end - Custom Potion Mixes - Potion potion = PotionUtils.getPotion(input); - Item item = input.getItem(); - -@@ -108,6 +121,54 @@ public class PotionBrewing { - return input; ++ // Paper end - Custom Potion Mixes + for (PotionBrewing.Mix mix : this.containerMixes) { + if (input.is(mix.from) && mix.ingredient.test(ingredient)) { + return PotionContents.createItemStack(mix.to.value(), optional.get()); +@@ -190,6 +203,54 @@ public class PotionBrewing { + builder.addMix(Potions.SLOW_FALLING, Items.REDSTONE, Potions.LONG_SLOW_FALLING); } + // Paper start - Custom Potion Mixes @@ -146,36 +146,36 @@ index a37573d06aeaa4ae05d26fa26c888524dd834421..96197185d1cba4a77bd6afd0e57615b4 + return CUSTOM_MIXES.remove(key) != null; + } + -+ public static void reload() { -+ POTION_MIXES.clear(); -+ CONTAINER_MIXES.clear(); -+ ALLOWED_CONTAINERS.clear(); ++ public void reload(FeatureFlagSet flags) { ++ potionMixes.clear(); ++ containerMixes.clear(); ++ containers.clear(); + CUSTOM_MIXES.clear(); -+ bootStrap(); ++ bootstrap(flags); + } + // Paper end - Custom Potion Mixes + - public static void bootStrap() { - addContainer(Items.POTION); - addContainer(Items.SPLASH_POTION); + public static class Builder { + private final List containers = new ArrayList<>(); + private final List> potionMixes = new ArrayList<>(); diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java -index b31d7053abf1d2432b4887dab2bd8f8cc5308554..9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10 100644 +index 3ebfd564d4bbf00da5919e966f3d047285845640..c1254088fc65fe46101c82cf2629cf0269711d39 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java -@@ -341,7 +341,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements +@@ -316,7 +316,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements - @Override - public boolean canPlaceItem(int slot, ItemStack stack) { -- return slot == 3 ? PotionBrewing.isIngredient(stack) : (slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE)) && this.getItem(slot).isEmpty()); -+ return slot == 3 ? PotionBrewing.isIngredient(stack) : (slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE) || PotionBrewing.isCustomInput(stack)) && this.getItem(slot).isEmpty()); // Paper - Custom Potion Mixes + return potionbrewer.isIngredient(stack); + } else { +- return slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE)) && this.getItem(slot).isEmpty(); ++ return slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE) || PotionBrewing.isCustomInput(stack)) && this.getItem(slot).isEmpty(); // Paper - Custom Potion Mixes + } } - @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f629991fa998d4dab89ed5c3d26b1b7a4f85b5cb..d8bec75e7f5c034051839818f51cdae71863608c 100644 +index 489fe1078a954ae7dd7133938bfd338d5fdeea5b..a7545b824dcf38a7e5e743e639f54d0e4d9b78aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -306,6 +306,7 @@ public final class CraftServer implements Server { +@@ -308,6 +308,7 @@ public final class CraftServer implements Server { private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper public static Exception excessiveVelEx; // Paper - Velocity warnings private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper @@ -183,16 +183,7 @@ index f629991fa998d4dab89ed5c3d26b1b7a4f85b5cb..d8bec75e7f5c034051839818f51cdae7 static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); -@@ -332,7 +333,7 @@ public final class CraftServer implements Server { - - CraftRegistry.setMinecraftRegistry(console.registryAccess()); - -- Potion.setPotionBrewer(new CraftPotionBrewer()); -+ Potion.setPotionBrewer(potionBrewer); // Paper - Custom Potion Mixes - // Ugly hack :( - - if (!Main.useConsole) { -@@ -3079,5 +3080,10 @@ public final class CraftServer implements Server { +@@ -3098,5 +3099,10 @@ public final class CraftServer implements Server { return datapackManager; } @@ -220,13 +211,41 @@ index 139dff90561ac6c51954c6289918a07aeea13a1b..6ba29875d78ede4aa7978ff689e588f7 if (bukkit == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java -index 09ac71b6b41c757832792d9ea8ac9288f8a7404f..2909a2736a0c9d863c7ab01e0ec259f7952080cc 100644 ---- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java +new file mode 100644 +index 0000000000000000000000000000000000000000..2909a2736a0c9d863c7ab01e0ec259f7952080cc +--- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java -@@ -28,4 +28,21 @@ public class CraftPotionBrewer implements PotionBrewer { - public PotionEffect createEffect(PotionEffectType potion, int duration, int amplifier) { - return new PotionEffect(potion, potion.isInstant() ? 1 : (int) (duration * potion.getDurationModifier()), amplifier); - } +@@ -0,0 +1,48 @@ ++package org.bukkit.craftbukkit.potion; ++ ++import com.google.common.base.Preconditions; ++import java.util.ArrayList; ++import java.util.Collection; ++import org.bukkit.potion.PotionBrewer; ++import org.bukkit.potion.PotionData; ++import org.bukkit.potion.PotionEffect; ++import org.bukkit.potion.PotionEffectType; ++import org.bukkit.potion.PotionType; ++ ++public class CraftPotionBrewer implements PotionBrewer { ++ ++ @Override ++ public Collection getEffects(PotionType type, boolean upgraded, boolean extended) { ++ Preconditions.checkArgument(!type.getKey().getKey().startsWith("strong_"), "Strong potion type cannot be used directly, got %s", type.getKey()); ++ Preconditions.checkArgument(!type.getKey().getKey().startsWith("long_"), "Extended potion type cannot be used directly, got %s", type.getKey()); ++ ++ return CraftPotionUtil.fromBukkit(new PotionData(type, upgraded, extended)).getPotionEffects(); ++ } ++ ++ @Override ++ public Collection getEffectsFromDamage(int damage) { ++ return new ArrayList(); ++ } ++ ++ @Override ++ public PotionEffect createEffect(PotionEffectType potion, int duration, int amplifier) { ++ return new PotionEffect(potion, potion.isInstant() ? 1 : (int) (duration * potion.getDurationModifier()), amplifier); ++ } + + // Paper start + @Override @@ -244,4 +263,4 @@ index 09ac71b6b41c757832792d9ea8ac9288f8a7404f..2909a2736a0c9d863c7ab01e0ec259f7 + net.minecraft.world.item.alchemy.PotionBrewing.reload(); + } + // Paper end - } ++} diff --git a/patches/unapplied/server/0723-Force-close-world-loading-screen.patch b/patches/server/0696-Force-close-world-loading-screen.patch similarity index 87% rename from patches/unapplied/server/0723-Force-close-world-loading-screen.patch rename to patches/server/0696-Force-close-world-loading-screen.patch index a62795f9be..d545f38445 100644 --- a/patches/unapplied/server/0723-Force-close-world-loading-screen.patch +++ b/patches/server/0696-Force-close-world-loading-screen.patch @@ -10,13 +10,13 @@ so we do not need that. The client only needs the chunk it is currently in to be loaded to close the loading screen, so we just send an empty one. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 95ba9b3bf957e5f744e85b3834a50ee2eb925a70..8ba90d47d7015c0081d341915035ce65baa6b9a4 100644 +index 825a63a23adceaea0de996f6c6122c44f5e700c0..4338015bbe0a0c33146190c81191fa62b6991499 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -399,6 +399,16 @@ public abstract class PlayerList { - +@@ -400,6 +400,16 @@ public abstract class PlayerList { + } // Paper start - Fire PlayerJoinEvent when Player is actually ready; move vehicle into method so it can be called above - short circuit around that code - onPlayerJoinFinish(player, worldserver1, s1); + this.onPlayerJoinFinish(player, worldserver1, s1); + // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead + if (player.isDeadOrDying()) { + net.minecraft.core.Holder plains = worldserver1.registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME) @@ -28,5 +28,5 @@ index 95ba9b3bf957e5f744e85b3834a50ee2eb925a70..8ba90d47d7015c0081d341915035ce65 + } + // Paper end - Send empty chunk } - private void mountSavedVehicle(ServerPlayer player, ServerLevel worldserver1, CompoundTag nbttagcompound) { + private void mountSavedVehicle(ServerPlayer player, ServerLevel worldserver1, Optional optional) { // Paper end - Fire PlayerJoinEvent when Player is actually ready diff --git a/patches/unapplied/server/0724-Fix-falling-block-spawn-methods.patch b/patches/server/0697-Fix-falling-block-spawn-methods.patch similarity index 81% rename from patches/unapplied/server/0724-Fix-falling-block-spawn-methods.patch rename to patches/server/0697-Fix-falling-block-spawn-methods.patch index c9e1a31533..13b83e45fa 100644 --- a/patches/unapplied/server/0724-Fix-falling-block-spawn-methods.patch +++ b/patches/server/0697-Fix-falling-block-spawn-methods.patch @@ -11,10 +11,10 @@ Restores the API behavior from previous versions of the server public net.minecraft.world.entity.item.FallingBlockEntity (Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 558d95381bca2f950824748b05e59e4ced7347c3..f2e4494a31dd7ca7e099c6960a9e6378ecac8727 100644 +index 2c7b94719fb815025f73e8cf98cb0323b9375923..4efbda6521f36ceae3b5b32ad0c79fa53b48b5bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1414,7 +1414,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1423,7 +1423,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(material != null, "Material cannot be null"); Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material); @@ -28,7 +28,7 @@ index 558d95381bca2f950824748b05e59e4ced7347c3..f2e4494a31dd7ca7e099c6960a9e6378 return (FallingBlock) entity.getBukkitEntity(); } -@@ -1423,7 +1428,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -1432,7 +1437,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(location != null, "Location cannot be null"); Preconditions.checkArgument(data != null, "BlockData cannot be null"); @@ -43,15 +43,15 @@ index 558d95381bca2f950824748b05e59e4ced7347c3..f2e4494a31dd7ca7e099c6960a9e6378 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -index 0aa6cd6da72c4a48d8bb48adeccc2bb49939fabd..08316493785e0cf1f93f07dda8016ca5956216f8 100644 +index abcfb3accb715a5a041de4b798cf3582d1fde325..7ba6302ecb72fa6e523054e7e3223d79eedf6589 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -@@ -378,7 +378,7 @@ public final class CraftEntityTypes { - register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null))); +@@ -386,7 +386,7 @@ public final class CraftEntityTypes { + register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null))); register(new EntityTypeData<>(EntityType.FALLING_BLOCK, FallingBlock.class, CraftFallingBlock::new, spawnData -> { BlockPos pos = BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z()); - return FallingBlockEntity.fall(spawnData.minecraftWorld(), pos, spawnData.world().getBlockState(pos)); + return new FallingBlockEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), spawnData.world().getBlockState(pos)); // Paper - create falling block entities correctly })); - register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY))); + register(new EntityTypeData<>(EntityType.FIREWORK_ROCKET, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY))); register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null))); diff --git a/patches/unapplied/server/0725-Expose-furnace-minecart-push-values.patch b/patches/server/0698-Expose-furnace-minecart-push-values.patch similarity index 100% rename from patches/unapplied/server/0725-Expose-furnace-minecart-push-values.patch rename to patches/server/0698-Expose-furnace-minecart-push-values.patch diff --git a/patches/unapplied/server/0726-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch b/patches/server/0699-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch similarity index 81% rename from patches/unapplied/server/0726-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch rename to patches/server/0699-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch index d80acbf9d0..8bb402858b 100644 --- a/patches/unapplied/server/0726-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch +++ b/patches/server/0699-Fix-cancelling-ProjectileHitEvent-for-piercing-arrow.patch @@ -15,26 +15,27 @@ piercing arrows to avoid duplicate damage being applied. protected net.minecraft.world.entity.projectile.Projectile hitCancelled 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 b3972c0aececb1d7170a47bbe8f1d6ce02d11331..c30f19162e33dbe8f018b7dc66210681b6027389 100644 +index 8e8258333e181491b2d5b61ebdb80de36e8179a9..2df84bc367f650c3d468e0f09ed565e68de43a82 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -@@ -298,6 +298,19 @@ public abstract class AbstractArrow extends Projectile { +@@ -305,10 +305,18 @@ public abstract class AbstractArrow extends Projectile { } } + // Paper start - Fix cancelling ProjectileHitEvent for piercing arrows -+ @Override -+ public void preOnHit(HitResult hitResult) { -+ super.preOnHit(hitResult); + @Override +- protected double getDefaultGravity() { +- return 0.05D; ++ public ProjectileDeflection preHitTargetOrDeflectSelf(HitResult hitResult) { + if (hitResult instanceof EntityHitResult entityHitResult && this.hitCancelled && this.getPierceLevel() > 0) { + if (this.piercingIgnoreEntityIds == null) { + this.piercingIgnoreEntityIds = new IntOpenHashSet(5); + } + this.piercingIgnoreEntityIds.add(entityHitResult.getEntity().getId()); + } -+ } ++ super.preHitTargetOrDeflectSelf(hitResult); + } + // Paper end - Fix cancelling ProjectileHitEvent for piercing arrows -+ + private boolean shouldFall() { return this.inGround && this.level().noCollision((new AABB(this.position(), this.position())).inflate(0.06D)); - } diff --git a/patches/unapplied/server/0727-More-Projectile-API.patch b/patches/server/0700-More-Projectile-API.patch similarity index 88% rename from patches/unapplied/server/0727-More-Projectile-API.patch rename to patches/server/0700-More-Projectile-API.patch index abcfbb28e9..06f684d5ba 100644 --- a/patches/unapplied/server/0727-More-Projectile-API.patch +++ b/patches/server/0700-More-Projectile-API.patch @@ -20,10 +20,10 @@ public net.minecraft.world.entity.projectile.Projectile canHitEntity(Lnet/minecr Co-authored-by: Nassim Jahnke diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -index 0204257ca0245830534592922e400a362c347715..252355d19e4f07406f78616e2366182758e0947b 100644 +index 14444325c0ed62c5f0ec230a7e191b0904e7b1ae..125941177bc7c74ee743449c5ea498781ee34975 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -@@ -101,6 +101,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie +@@ -100,6 +100,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie @Override protected void onHit(HitResult hitResult) { super.onHit(hitResult); @@ -34,31 +34,31 @@ index 0204257ca0245830534592922e400a362c347715..252355d19e4f07406f78616e23661827 + // Paper end - More projectile API if (!this.level().isClientSide) { ItemStack itemstack = this.getItem(); - Potion potionregistry = PotionUtils.getPotion(itemstack); -@@ -114,7 +119,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie + PotionContents potioncontents = (PotionContents) itemstack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY); +@@ -111,7 +116,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie if (this.isLingering()) { - showParticles = this.makeAreaOfEffectCloud(itemstack, potionregistry, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper + showParticles = this.makeAreaOfEffectCloud(itemstack, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper } else { - showParticles = this.applySplash(list, hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper + showParticles = this.applySplash(list, hitResult != null && hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper - More projectile API } } -@@ -176,7 +181,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie +@@ -173,7 +178,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie } -- private boolean applySplash(List list, @Nullable Entity entity, HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events -+ private boolean applySplash(List list, @Nullable Entity entity, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events & More projectile API +- private boolean applySplash(Iterable iterable, @Nullable Entity entity, HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events ++ private boolean applySplash(Iterable iterable, @Nullable Entity entity, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events & More projectile API AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D); - List list1 = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb); + List list = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb); Map affected = new HashMap(); // CraftBukkit -@@ -253,7 +258,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie +@@ -251,7 +256,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie } -- private boolean makeAreaOfEffectCloud(ItemStack itemstack, Potion potionregistry, HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - return boolean -+ private boolean makeAreaOfEffectCloud(ItemStack itemstack, Potion potionregistry, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - return boolean & More projectile API +- private boolean makeAreaOfEffectCloud(PotionContents potioncontents, HitResult position) { // CraftBukkit - Pass MovingObjectPosition ++ private boolean makeAreaOfEffectCloud(PotionContents potioncontents, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - More projectile API AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ()); Entity entity = this.getOwner(); @@ -133,33 +133,11 @@ index 91c2d0b40d3fca86938cd454e1415a4eea3df7c7..c1c52f4fc5f900fac4098e5e37c52dfc + // Paper end - More projectile API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -index a24a6fe5bf634bb02654b0ec4f771aa07458ce84..0fd2677181d741e553b9825c8c319a209194ec46 100644 +index 62fe1ae5cfdcba84d8d1456a9939e4649aea8794..291e97eedda1c6d77d53631253be8c3333b88ff2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java -@@ -60,20 +60,7 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { - this.getHandle().setCritArrow(critical); - } - -- @Override -- public ProjectileSource getShooter() { -- return this.getHandle().projectileSource; -- } -- -- @Override -- public void setShooter(ProjectileSource shooter) { -- if (shooter instanceof Entity) { -- this.getHandle().setOwner(((CraftEntity) shooter).getHandle()); -- } else { -- this.getHandle().setOwner(null); -- } -- this.getHandle().projectileSource = shooter; -- } -+ // Paper - moved to AbstractProjectile - - @Override - public boolean isInBlock() { -@@ -101,6 +88,35 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow { - this.getHandle().pickup = net.minecraft.world.entity.projectile.AbstractArrow.Pickup.byOrdinal(status.ordinal()); +@@ -72,6 +72,35 @@ public class CraftArrow extends CraftAbstractArrow implements Arrow { + return false; } + // Paper start @@ -192,10 +170,10 @@ index a24a6fe5bf634bb02654b0ec4f771aa07458ce84..0fd2677181d741e553b9825c8c319a20 + // Paper end + @Override - public void setTicksLived(int value) { - super.setTicksLived(value); + public boolean hasCustomEffects() { + return !this.getHandle().getPotionContents().customEffects().isEmpty(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java -index e1a2f0924da6ebcdf332040f922226af5d8a2d45..a8699b274b51c5f6691557c3c3db88436f05e304 100644 +index 3815b68e139702f3f97c4fa2a77a0314d83fa758..939a0713c74dd92273190017d3976d894f002d95 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java @@ -32,20 +32,7 @@ public class CraftFireball extends AbstractProjectile implements Fireball { @@ -460,10 +438,10 @@ index d685d09cae5f862c0004f148298c800736d2139e..636c4481e3afdf20197e502cf221f5d3 public String toString() { return "CraftShulkerBullet"; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -index 269af20a6d0d100909a0aea0bdba307ea0658f3e..d5f1681a476c8fe2ae128a84910f4bf04063b75a 100644 +index a7443a61e796e8b8f4b480085a77e098d1b134e5..a5edfd484737b5f6af8aa1d9a1d31d7d2710f7da 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java -@@ -35,11 +35,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw +@@ -36,11 +36,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw @Override public void setItem(ItemStack item) { Preconditions.checkArgument(item != null, "ItemStack cannot be null"); @@ -497,10 +475,10 @@ index 269af20a6d0d100909a0aea0bdba307ea0658f3e..d5f1681a476c8fe2ae128a84910f4bf0 public net.minecraft.world.entity.projectile.ThrownPotion getHandle() { return (net.minecraft.world.entity.projectile.ThrownPotion) this.entity; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java -index 20f9735c7cb76024e15dbdca7684f5c560876175..8a6af0db8e0aa0cffbf19584be747076c2c8ee44 100644 +index e374b9f40eddca13b30855d25a2030f8df98138f..4fc893378fb0568ddcffc7593d66df6bfe23f659 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java -@@ -53,5 +53,15 @@ public class CraftTrident extends CraftArrow implements Trident { +@@ -53,5 +53,15 @@ public class CraftTrident extends CraftAbstractArrow implements Trident { com.google.common.base.Preconditions.checkArgument(loyaltyLevel >= 0 && loyaltyLevel <= 127, "The loyalty level has to be between 0 and 127"); this.getHandle().setLoyalty((byte) loyaltyLevel); } @@ -517,10 +495,10 @@ index 20f9735c7cb76024e15dbdca7684f5c560876175..8a6af0db8e0aa0cffbf19584be747076 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7d72ccdd82daa6afe85859f5bc6ec7b187622384..fb0426a1d864f3c60637e394e5bedb3963677df1 100644 +index 28d371e59d8780bf6e154bac56ee189b3b43b201..dd092e44a18e238e4a8b4d8a791ef4267af01c04 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -833,19 +833,19 @@ public class CraftEventFactory { +@@ -832,19 +832,19 @@ public class CraftEventFactory { /** * PotionSplashEvent */ @@ -543,7 +521,7 @@ index 7d72ccdd82daa6afe85859f5bc6ec7b187622384..fb0426a1d864f3c60637e394e5bedb39 hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity(); } -@@ -854,20 +854,20 @@ public class CraftEventFactory { +@@ -853,20 +853,20 @@ public class CraftEventFactory { return event; } @@ -568,10 +546,10 @@ index 7d72ccdd82daa6afe85859f5bc6ec7b187622384..fb0426a1d864f3c60637e394e5bedb39 } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index f3195b37c314a1327752ece7ec33dfdae16f0bec..6b75314023adf313937990e31323dff9bacc564b 100644 +index 13e6fc9f42d63fdbd659462070dc7f0767fbb1d9..79529a5208810d25aeab537eac70ed9c6583ef18 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -@@ -298,12 +298,20 @@ public final class CraftItemStack extends ItemStack { +@@ -293,12 +293,20 @@ public final class CraftItemStack extends ItemStack { public ItemMeta getItemMeta() { return CraftItemStack.getItemMeta(this.handle); } @@ -592,5 +570,5 @@ index f3195b37c314a1327752ece7ec33dfdae16f0bec..6b75314023adf313937990e31323dff9 - switch (CraftItemStack.getType(item)) { + switch (material) { // Paper case WRITTEN_BOOK: - return new CraftMetaBookSigned(item.getTag()); + return new CraftMetaBookSigned(item.getComponentsPatch()); case WRITABLE_BOOK: diff --git a/patches/unapplied/server/0728-Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/0701-Fix-swamp-hut-cat-generation-deadlock.patch similarity index 71% rename from patches/unapplied/server/0728-Fix-swamp-hut-cat-generation-deadlock.patch rename to patches/server/0701-Fix-swamp-hut-cat-generation-deadlock.patch index 8a176245ca..6bc7d4bda7 100644 --- a/patches/unapplied/server/0728-Fix-swamp-hut-cat-generation-deadlock.patch +++ b/patches/server/0701-Fix-swamp-hut-cat-generation-deadlock.patch @@ -10,23 +10,23 @@ indefinitely. Instead of using the world state, we use the already supplied ServerLevelAccessor which will always have the chunk available. diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index 534630b0161c8d869e49e7a59572193550be0671..7dfd2b17e82a80683af28779d0bd8f64a909c3b6 100644 +index f3b0e5a97ad5d344741dfa3b7c864712c7ba8802..d2e273f58b4c9b65642980d3f47e01ae92166e46 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -364,7 +364,7 @@ public class Cat extends TamableAnimal implements VariantHolder { - }); +@@ -367,7 +367,7 @@ public class Cat extends TamableAnimal implements VariantHolder startsForStructure(ChunkPos pos, Predicate predicate) { @@ -40,20 +40,25 @@ index 09e0c6b6bddcba2f4a59838ac63cda3188f71e41..07eb481380e8fd4e492f36342ba63357 Builder builder = ImmutableList.builder(); for (Entry entry : map.entrySet()) { -@@ -111,10 +116,15 @@ public class StructureManager { +@@ -116,10 +121,20 @@ public class StructureManager { } - public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey structureTag) { + public StructureStart getStructureWithPieceAt(BlockPos pos, Predicate> predicate) { + // Paper start - Fix swamp hut cat generation deadlock -+ return this.getStructureWithPieceAt(pos, structureTag, null); ++ return this.getStructureWithPieceAt(pos, predicate, null); + } -+ public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey structureTag, @Nullable ServerLevelAccessor levelAccessor) { ++ ++ public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey tag, @Nullable ServerLevelAccessor levelAccessor) { ++ return this.getStructureWithPieceAt(pos, structure -> structure.is(tag), levelAccessor); ++ } ++ ++ public StructureStart getStructureWithPieceAt(BlockPos pos, Predicate> predicate, @Nullable ServerLevelAccessor levelAccessor) { + // Paper end - Fix swamp hut cat generation deadlock Registry registry = this.registryAccess().registryOrThrow(Registries.STRUCTURE); for (StructureStart structureStart : this.startsForStructure( -- new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(reference -> reference.is(structureTag)).orElse(false) -+ new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(reference -> reference.is(structureTag)).orElse(false), levelAccessor // Paper - Fix swamp hut cat generation deadlock +- new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(predicate::test).orElse(false) ++ new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(predicate::test).orElse(false), levelAccessor // Paper - Fix swamp hut cat generation deadlock )) { if (this.structureHasPieceAt(pos, structureStart)) { return structureStart; diff --git a/patches/unapplied/server/0729-Don-t-allow-vehicle-movement-from-players-while-tele.patch b/patches/server/0702-Don-t-allow-vehicle-movement-from-players-while-tele.patch similarity index 90% rename from patches/unapplied/server/0729-Don-t-allow-vehicle-movement-from-players-while-tele.patch rename to patches/server/0702-Don-t-allow-vehicle-movement-from-players-while-tele.patch index d4cf7ed2df..584747535c 100644 --- a/patches/unapplied/server/0729-Don-t-allow-vehicle-movement-from-players-while-tele.patch +++ b/patches/server/0702-Don-t-allow-vehicle-movement-from-players-while-tele.patch @@ -7,10 +7,10 @@ Bring the vehicle move packet behavior in line with the regular player move packet. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 7127c6f163cc00eb439eb37665df3e1a4bf27cc2..47d47d1979ca543679884e256dc805d2362d619d 100644 +index 39ba1860b6c0384f04fa9219c976c144cc4027fe..21922416b68d6097c44749fc18fcf1f5634323f4 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -464,6 +464,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -490,6 +490,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause } else { Entity entity = this.player.getRootVehicle(); diff --git a/patches/unapplied/server/0730-Implement-getComputedBiome-API.patch b/patches/server/0703-Implement-getComputedBiome-API.patch similarity index 93% rename from patches/unapplied/server/0730-Implement-getComputedBiome-API.patch rename to patches/server/0703-Implement-getComputedBiome-API.patch index 851c8f573b..75326082a2 100644 --- a/patches/unapplied/server/0730-Implement-getComputedBiome-API.patch +++ b/patches/server/0703-Implement-getComputedBiome-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement getComputedBiome API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index af14244caba22e750ee7baba03bb7ce267795b21..fbcf1320ef9c1817b24aa8724cd6cf07319c20b9 100644 +index 4932ba59a6b70b405f7dd05358f6bb00b629d34c..d1c265733941874002f6dfc7543917af88600659 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java @@ -76,6 +76,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor { @@ -41,7 +41,7 @@ index 068b3735b6c50a7a2053c7dc39856f728fb7218a..6d10396347b69d9243ab902ecc68ede9 public void setBiome(Biome bio) { this.getWorld().setBiome(this.getX(), this.getY(), this.getZ(), bio); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java -index 423a853192c87eb81b79cb6f17866c4665cc1655..ca9bb98ccfc3863c2ba538953470ab9e2b8a2f29 100644 +index 09c282b3fbbdec82f21ab97fe0a486eacc2c2e8b..06ab1ac654e0c6f0ab7208783d186ed306ce204f 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java @@ -165,6 +165,14 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe diff --git a/patches/unapplied/server/0731-Make-some-itemstacks-nonnull.patch b/patches/server/0704-Make-some-itemstacks-nonnull.patch similarity index 100% rename from patches/unapplied/server/0731-Make-some-itemstacks-nonnull.patch rename to patches/server/0704-Make-some-itemstacks-nonnull.patch diff --git a/patches/unapplied/server/0732-Implement-enchantWithLevels-API.patch b/patches/server/0705-Implement-enchantWithLevels-API.patch similarity index 92% rename from patches/unapplied/server/0732-Implement-enchantWithLevels-API.patch rename to patches/server/0705-Implement-enchantWithLevels-API.patch index ed80635228..8fc5a8e3f7 100644 --- a/patches/unapplied/server/0732-Implement-enchantWithLevels-API.patch +++ b/patches/server/0705-Implement-enchantWithLevels-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement enchantWithLevels API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index ef0c6e04a89704688f7b5461b27c0036abbf647d..c421649a0c88ee9c773bb6985f7114e58f08a7a1 100644 +index acf57732dd902bd23166e60788477b69e023cb35..071f4fe53fbea333b5db52ac719c5e6b833ffe19 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -579,4 +579,20 @@ public final class CraftItemFactory implements ItemFactory { +@@ -589,4 +589,20 @@ public final class CraftItemFactory implements ItemFactory { return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror(); } // Paper end - old getSpawnEgg API diff --git a/patches/unapplied/server/0733-Fix-saving-in-unloadWorld.patch b/patches/server/0706-Fix-saving-in-unloadWorld.patch similarity index 83% rename from patches/unapplied/server/0733-Fix-saving-in-unloadWorld.patch rename to patches/server/0706-Fix-saving-in-unloadWorld.patch index a844d1cd8e..d1ed5fc656 100644 --- a/patches/unapplied/server/0733-Fix-saving-in-unloadWorld.patch +++ b/patches/server/0706-Fix-saving-in-unloadWorld.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix saving in unloadWorld Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d8bec75e7f5c034051839818f51cdae71863608c..713d36b8bcb3f39f7f0cff61532199416970bcf4 100644 +index a7545b824dcf38a7e5e743e639f54d0e4d9b78aa..27072040887df4ff117179cfa5e7a39ef27c7501 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1343,7 +1343,7 @@ public final class CraftServer implements Server { +@@ -1349,7 +1349,7 @@ public final class CraftServer implements Server { try { if (save) { diff --git a/patches/unapplied/server/0734-Buffer-OOB-setBlock-calls.patch b/patches/server/0707-Buffer-OOB-setBlock-calls.patch similarity index 58% rename from patches/unapplied/server/0734-Buffer-OOB-setBlock-calls.patch rename to patches/server/0707-Buffer-OOB-setBlock-calls.patch index ae47164389..34540dcfe8 100644 --- a/patches/unapplied/server/0734-Buffer-OOB-setBlock-calls.patch +++ b/patches/server/0707-Buffer-OOB-setBlock-calls.patch @@ -13,10 +13,10 @@ we'll also only gen a trace for the first one, I see no real pressing need to generate more, given that that would *massively* negate this patch otherwise diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -index d11741d2618976bdb51f75d823f260f32d5bafc9..ff94af5be8de374f5cde2607eebbb23e65705581 100644 +index 744efc6cdc99f653a1eb9d4f26af8a7c34627f5e..a343bb1b1ee2cd2ecd75be00aa91d5418dcdec76 100644 --- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java +++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java -@@ -275,6 +275,7 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -283,6 +283,7 @@ public class WorldGenRegion implements WorldGenLevel { } } @@ -24,17 +24,18 @@ index d11741d2618976bdb51f75d823f260f32d5bafc9..ff94af5be8de374f5cde2607eebbb23e @Override public boolean ensureCanWrite(BlockPos pos) { int i = SectionPos.blockToSectionCoord(pos.getX()); -@@ -294,7 +295,15 @@ public class WorldGenRegion implements WorldGenLevel { +@@ -302,7 +303,15 @@ public class WorldGenRegion implements WorldGenLevel { return true; } else { +- Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); + // Paper start - Buffer OOB setBlock calls + if (!hasSetFarWarned) { - Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); -+ hasSetFarWarned = true; -+ if (this.getServer() != null && this.getServer().isDebugging()) { -+ io.papermc.paper.util.TraceUtil.dumpTraceForThread("far setBlock call"); -+ } ++ Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get())); ++ hasSetFarWarned = true; ++ if (this.getServer() != null && this.getServer().isDebugging()) { ++ io.papermc.paper.util.TraceUtil.dumpTraceForThread("far setBlock call"); ++ } + } + // Paper end - Buffer OOB setBlock calls return false; diff --git a/patches/unapplied/server/0735-Add-TameableDeathMessageEvent.patch b/patches/server/0708-Add-TameableDeathMessageEvent.patch similarity index 90% rename from patches/unapplied/server/0735-Add-TameableDeathMessageEvent.patch rename to patches/server/0708-Add-TameableDeathMessageEvent.patch index a3f8770f2a..355d8192ca 100644 --- a/patches/unapplied/server/0735-Add-TameableDeathMessageEvent.patch +++ b/patches/server/0708-Add-TameableDeathMessageEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add TameableDeathMessageEvent diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java -index ae474216d54317a9d102cb6832225074c94c8e4b..01b91388577b6013d7bd5c9112a03f818fee1f9c 100644 +index 8c387df4d1e0b714edb07f177e85fe2ec4706b2a..ed2514de46d0939259ca4e45a6dc96d7c1dac20d 100644 --- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java +++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java -@@ -195,7 +195,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { +@@ -196,7 +196,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { @Override public void die(DamageSource damageSource) { if (!this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { diff --git a/patches/unapplied/server/0736-Fix-new-block-data-for-EntityChangeBlockEvent.patch b/patches/server/0709-Fix-new-block-data-for-EntityChangeBlockEvent.patch similarity index 85% rename from patches/unapplied/server/0736-Fix-new-block-data-for-EntityChangeBlockEvent.patch rename to patches/server/0709-Fix-new-block-data-for-EntityChangeBlockEvent.patch index 91ca1e4916..329db7ba4c 100644 --- a/patches/unapplied/server/0736-Fix-new-block-data-for-EntityChangeBlockEvent.patch +++ b/patches/server/0709-Fix-new-block-data-for-EntityChangeBlockEvent.patch @@ -14,10 +14,10 @@ Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Jake Potrebic diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java -index b7abd8309a7d9744d3b3df9be8cad54f8909cc15..d3a2a6dee2d83b3df0ddc521c080f7d72b709461 100644 +index 6a7052cd6ec88ed4aaea2fef0ebc750060d1dec0..2ade08d1466660ee1787fa97908002ef56389712 100644 --- a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java +++ b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java -@@ -107,7 +107,7 @@ public class HarvestFarmland extends Behavior { +@@ -108,7 +108,7 @@ public class HarvestFarmland extends Behavior { Block block1 = world.getBlockState(this.aboveFarmlandPos.below()).getBlock(); if (block instanceof CropBlock && ((CropBlock) block).isMaxAge(iblockdata)) { @@ -65,10 +65,10 @@ index f4bc556e245179d0a4710e5255dd289aaafdceb7..d802985f1431be4332c07f0dab88feeb this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2); } diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java -index 6e1c67ad757e466d122badd547ee3f8421eba9ba..cf4859814a60468f683e3afe285b4934d35e9704 100644 +index 8feb886acf3b60356f1cba9e09a0cdea9ea8266a..b58300e114e2e27ac68d7a9489bc52b127c9bc17 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java +++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java -@@ -580,7 +580,7 @@ public class Rabbit extends Animal implements VariantHolder { +@@ -577,7 +577,7 @@ public class Rabbit extends Animal implements VariantHolder { if (i == 0) { // CraftBukkit start @@ -78,36 +78,36 @@ index 6e1c67ad757e466d122badd547ee3f8421eba9ba..cf4859814a60468f683e3afe285b4934 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -index 25f611b35a5710c595574d2d6ed50c442ca55721..6c215470ad05d59f903cbeff15088a03b42c3f66 100644 +index b5cb4e4682f66ac9423af8d1547d0f1a4f9e6c5d..aa22829c3d41118664a872540fdc8f716120c407 100644 --- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java +++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java -@@ -375,7 +375,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob +@@ -377,7 +377,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob - if (WitherBoss.canDestroy(iblockdata)) { - // CraftBukkit start -- if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) { -+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state - continue; - } - // CraftBukkit end + if (WitherBoss.canDestroy(iblockdata)) { + // CraftBukkit start +- if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) { ++ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state + continue; + } + // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index c360135b923aa8d1ed2c7caf97ede981cb605cf2..f33c03e81b7ff643741f56eea055e6af260de618 100644 +index 57f84a0eccbdb051adddc25a1a7126f60c7c274b..260202fab3ac300552c557b44dcf251f083c6a78 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -580,7 +580,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -563,7 +563,7 @@ public class EnderMan extends Monster implements NeutralMob { boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition); if (iblockdata.is(BlockTags.ENDERMAN_HOLDABLE) && flag) { - if (CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.defaultBlockState())) { // CraftBukkit - Place event + if (CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // CraftBukkit - Place event // Paper - fix wrong block state world.removeBlock(blockposition, false); - world.gameEvent(GameEvent.BLOCK_DESTROY, blockposition, GameEvent.Context.of(this.enderman, iblockdata)); + world.gameEvent((Holder) GameEvent.BLOCK_DESTROY, blockposition, GameEvent.Context.of(this.enderman, iblockdata)); this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState()); diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -index aac60e85cd6dba7d87f4a1663c2c62952521d112..151acc43c96b4545ce92d3d559d8e1591874b4b5 100644 +index cec801ba14bed8b043b2375f1bf9e7811a63e995..2d7b7c949faaaaae94c0043132a4a822f55df104 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java +++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java -@@ -158,7 +158,7 @@ public class Ravager extends Raider { +@@ -150,7 +150,7 @@ public class Ravager extends Raider { if (block instanceof LeavesBlock) { // CraftBukkit start @@ -117,10 +117,10 @@ index aac60e85cd6dba7d87f4a1663c2c62952521d112..151acc43c96b4545ce92d3d559d8e159 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java -index 0e2725d92002c181f542e2335cdd6e6de69155e1..fcd5cc3ff8d4b38f4dea08f78723db3dac53ffde 100644 +index 9ff42b0ae2b82dc3092e38e1439d89b4ab554b17..860e385fc83f9787dca92efe35d21fd69c4dd635 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java +++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java -@@ -182,7 +182,8 @@ public class Silverfish extends Monster { +@@ -162,7 +162,8 @@ public class Silverfish extends Monster { if (block instanceof InfestedBlock) { // CraftBukkit start @@ -131,10 +131,10 @@ index 0e2725d92002c181f542e2335cdd6e6de69155e1..fcd5cc3ff8d4b38f4dea08f78723db3d } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -index 252355d19e4f07406f78616e2366182758e0947b..2b05824f5826a2da2539f8a6d373a16c185aa80a 100644 +index 125941177bc7c74ee743449c5ea498781ee34975..d5e9f2bb692a162c3a2ed93498aa9649d6554cd9 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java +++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java -@@ -307,7 +307,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie +@@ -290,7 +290,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie if (iblockdata.is(BlockTags.FIRE)) { // CraftBukkit start @@ -144,7 +144,7 @@ index 252355d19e4f07406f78616e2366182758e0947b..2b05824f5826a2da2539f8a6d373a16c } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java b/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java -index 87c66bf8fee56e77b25498d9b2524fe2b6fd6549..0ab1bbd7c8dc8e45f754434357898d8fc990a021 100644 +index bb1487dd2c8e4374f75a102ab5e17ce9b2d31114..6709cb6b657a8612781c2fe4dd76ee38f329c5ba 100644 --- a/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java @@ -284,7 +284,7 @@ public class ChorusFlowerBlock extends Block { @@ -157,10 +157,10 @@ index 87c66bf8fee56e77b25498d9b2524fe2b6fd6549..0ab1bbd7c8dc8e45f754434357898d8f } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java -index 998e43e8dc6bd6b741bdcb77d2b75df8ab2feefc..d0e679745a794228bf62a9aa59422776760f3867 100644 +index ec9190abe3edf7c3845156bb967dddf6ae7c30ff..95cb7492ac691a8e8aa9894f701b802a7eda5446 100644 --- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java -@@ -133,7 +133,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate +@@ -134,7 +134,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate if (projectile.mayInteract(world, blockposition) && projectile.mayBreak(world) && projectile instanceof ThrownTrident && projectile.getDeltaMovement().length() > 0.6D) { // CraftBukkit start @@ -170,10 +170,10 @@ index 998e43e8dc6bd6b741bdcb77d2b75df8ab2feefc..d0e679745a794228bf62a9aa59422776 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/block/TntBlock.java b/src/main/java/net/minecraft/world/level/block/TntBlock.java -index 4edd2e7bb62df65d6da8c8a623cf03e7e947bf75..5fa5e8c838720eb1491aea73d462f4bc7d779956 100644 +index 58b8c3cc579a1d34af26c44d6a7413bd5cc9e4e7..aef1638fe0b41eb04a55671ac1163753e9a8e70f 100644 --- a/src/main/java/net/minecraft/world/level/block/TntBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TntBlock.java -@@ -163,7 +163,7 @@ public class TntBlock extends Block { +@@ -160,7 +160,7 @@ public class TntBlock extends Block { if (projectile.isOnFire() && projectile.mayInteract(world, blockposition)) { // CraftBukkit start @@ -183,7 +183,7 @@ index 4edd2e7bb62df65d6da8c8a623cf03e7e947bf75..5fa5e8c838720eb1491aea73d462f4bc } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java -index 61abbcfe97e3d3e3da5ee658672549d14594ad17..05e14322e519d1399e87beb532e1cc4a95f689aa 100644 +index edc20745649b0837f1371c8d29e71fc0c8e5528f..932831bb5632ead5850842fc77192c841571162e 100644 --- a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java +++ b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java @@ -37,7 +37,7 @@ public class WaterlilyBlock extends BushBlock { @@ -196,10 +196,10 @@ index 61abbcfe97e3d3e3da5ee658672549d14594ad17..05e14322e519d1399e87beb532e1cc4a } // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index fb0426a1d864f3c60637e394e5bedb3963677df1..13366b67b20b812a037a199b8a1e6609a4a54444 100644 +index dd092e44a18e238e4a8b4d8a791ef4267af01c04..70489085763475d29ddddc0bd3279974d0eb73cf 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1361,11 +1361,11 @@ public class CraftEventFactory { +@@ -1356,11 +1356,11 @@ public class CraftEventFactory { return event; } diff --git a/patches/unapplied/server/0737-fix-player-loottables-running-when-mob-loot-gamerule.patch b/patches/server/0710-fix-player-loottables-running-when-mob-loot-gamerule.patch similarity index 88% rename from patches/unapplied/server/0737-fix-player-loottables-running-when-mob-loot-gamerule.patch rename to patches/server/0710-fix-player-loottables-running-when-mob-loot-gamerule.patch index 5fc7657405..0f56e9ee1f 100644 --- a/patches/unapplied/server/0737-fix-player-loottables-running-when-mob-loot-gamerule.patch +++ b/patches/server/0710-fix-player-loottables-running-when-mob-loot-gamerule.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix player loottables running when mob loot gamerule is false diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index b5a3587a9074a1a2fcc2252d2db8b184b6ab6793..3f8f0e88339d847c44120b7657161bf43402db74 100644 +index 3db8f376f3a73256d13fd778bb1c80606e6712d9..c9c5e667c2aa26db1fb0038e40598d04a7c80889 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -875,12 +875,14 @@ public class ServerPlayer extends Player { +@@ -942,12 +942,14 @@ public class ServerPlayer extends Player { } } } diff --git a/patches/unapplied/server/0738-Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/0711-Ensure-entity-passenger-world-matches-ridden-entity.patch similarity index 81% rename from patches/unapplied/server/0738-Ensure-entity-passenger-world-matches-ridden-entity.patch rename to patches/server/0711-Ensure-entity-passenger-world-matches-ridden-entity.patch index 2c800da975..b656e4e0e3 100644 --- a/patches/unapplied/server/0738-Ensure-entity-passenger-world-matches-ridden-entity.patch +++ b/patches/server/0711-Ensure-entity-passenger-world-matches-ridden-entity.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity Bad plugins doing this would cause some obvious problems... diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d391114787e4f7491241b6abc45dcf3f2a7f9fb5..f08908238cc9680310a2b37089b051bf6fdf5ee3 100644 +index 8e09bfb7c1b4fb34e6615b0cf774bc8e6cae29fa..3bd13975934e8f61b41c4c08b73ead6e0f45ffac 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2580,7 +2580,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2611,7 +2611,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } public boolean startRiding(Entity entity, boolean force) { diff --git a/patches/unapplied/server/0739-cache-resource-keys.patch b/patches/server/0712-cache-resource-keys.patch similarity index 100% rename from patches/unapplied/server/0739-cache-resource-keys.patch rename to patches/server/0712-cache-resource-keys.patch diff --git a/patches/unapplied/server/0740-Allow-changing-the-EnderDragon-podium.patch b/patches/server/0713-Allow-changing-the-EnderDragon-podium.patch similarity index 96% rename from patches/unapplied/server/0740-Allow-changing-the-EnderDragon-podium.patch rename to patches/server/0713-Allow-changing-the-EnderDragon-podium.patch index a9354ec22b..623c4b9689 100644 --- a/patches/unapplied/server/0740-Allow-changing-the-EnderDragon-podium.patch +++ b/patches/server/0713-Allow-changing-the-EnderDragon-podium.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow changing the EnderDragon podium diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd4c1e8c13 100644 +index 789823dbaaf2e23942749145dbb64071539624aa..e8be7ddbef12b27ed5c5fcfa8b726d5a85058aa9 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -104,6 +104,10 @@ public class EnderDragon extends Mob implements Enemy { +@@ -102,6 +102,10 @@ public class EnderDragon extends Mob implements Enemy { private final int[] nodeAdjacency; private final BinaryHeap openSet; private final Explosion explosionSource; // CraftBukkit - reusable source for CraftTNTPrimed.getSource() @@ -19,7 +19,7 @@ index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd public EnderDragon(EntityType entitytypes, Level world) { super(EntityType.ENDER_DRAGON, world); -@@ -144,6 +148,19 @@ public class EnderDragon extends Mob implements Enemy { +@@ -142,6 +146,19 @@ public class EnderDragon extends Mob implements Enemy { return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0D); } @@ -39,7 +39,7 @@ index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd @Override public boolean isFlapping() { float f = Mth.cos(this.flapTime * 6.2831855F); -@@ -995,7 +1012,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -993,7 +1010,7 @@ public class EnderDragon extends Mob implements Enemy { d0 = segment2[1] - segment1[1]; } } else { @@ -48,7 +48,7 @@ index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd double d1 = Math.max(Math.sqrt(blockposition.distToCenterSqr(this.position())) / 4.0D, 1.0D); d0 = (double) segmentOffset / d1; -@@ -1022,7 +1039,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -1020,7 +1037,7 @@ public class EnderDragon extends Mob implements Enemy { vec3d = this.getViewVector(tickDelta); } } else { diff --git a/patches/unapplied/server/0741-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch b/patches/server/0714-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch similarity index 96% rename from patches/unapplied/server/0741-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch rename to patches/server/0714-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch index aa5772fe8a..05d5b9189b 100644 --- a/patches/unapplied/server/0741-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch +++ b/patches/server/0714-Fix-NBT-pieces-overriding-a-block-entity-during-worl.patch @@ -9,7 +9,7 @@ is not a WorldGenRegion, we can bypass the deadlock entirely. See https://bugs.mojang.com/browse/MC-246262 diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java -index be8aab51a1b92a3a0cc94976975fc3aabc46f0b4..ae8a42261337bf736d0cc1bbe18da2b773417ca4 100644 +index bd401b38239fb7e510f82f458f9336b7da372da0..b5365dce7882c98b5be4f5df877165eee80933dd 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java +++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java @@ -279,7 +279,11 @@ public class StructureTemplate { diff --git a/patches/unapplied/server/0742-Prevent-tile-entity-copies-loading-chunks.patch b/patches/server/0715-Prevent-tile-entity-copies-loading-chunks.patch similarity index 82% rename from patches/unapplied/server/0742-Prevent-tile-entity-copies-loading-chunks.patch rename to patches/server/0715-Prevent-tile-entity-copies-loading-chunks.patch index 845fc85bb1..4002fa17f8 100644 --- a/patches/unapplied/server/0742-Prevent-tile-entity-copies-loading-chunks.patch +++ b/patches/server/0715-Prevent-tile-entity-copies-loading-chunks.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Prevent tile entity copies loading chunks diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 47d47d1979ca543679884e256dc805d2362d619d..19bc63da6bca5b3ff62bb2a148b35e0d3f93bb1d 100644 +index 21922416b68d6097c44749fc18fcf1f5634323f4..ae440c8b7597d08ae62dfe301b20886f82c720ca 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3111,7 +3111,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound); +@@ -3195,7 +3195,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + BlockPos blockposition = BlockEntity.getPosFromTag(customdata.getUnsafe()); if (this.player.level().isLoaded(blockposition)) { - BlockEntity tileentity = this.player.level().getBlockEntity(blockposition); @@ -21,4 +21,4 @@ index 47d47d1979ca543679884e256dc805d2362d619d..19bc63da6bca5b3ff62bb2a148b35e0d + // Paper end - Prevent tile entity copies loading chunks if (tileentity != null) { - tileentity.saveToItem(itemstack); + tileentity.saveToItem(itemstack, this.player.level().registryAccess()); diff --git a/patches/unapplied/server/0743-Use-username-instead-of-display-name-in-PlayerList-g.patch b/patches/server/0716-Use-username-instead-of-display-name-in-PlayerList-g.patch similarity index 87% rename from patches/unapplied/server/0743-Use-username-instead-of-display-name-in-PlayerList-g.patch rename to patches/server/0716-Use-username-instead-of-display-name-in-PlayerList-g.patch index ce925b89b7..c0dbb37d31 100644 --- a/patches/unapplied/server/0743-Use-username-instead-of-display-name-in-PlayerList-g.patch +++ b/patches/server/0716-Use-username-instead-of-display-name-in-PlayerList-g.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use username instead of display name in diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 8ba90d47d7015c0081d341915035ce65baa6b9a4..6fbcea8fd32a425cab936330d5d9545782e03346 100644 +index 4338015bbe0a0c33146190c81191fa62b6991499..42d609cc3bd13e957b6f2194552da34393849790 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1435,7 +1435,7 @@ public abstract class PlayerList { +@@ -1434,7 +1434,7 @@ public abstract class PlayerList { // CraftBukkit start public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) { ServerStatsCounter serverstatisticmanager = entityhuman.getStats(); diff --git a/patches/unapplied/server/0744-Expand-PlayerItemDamageEvent.patch b/patches/server/0717-Expand-PlayerItemDamageEvent.patch similarity index 88% rename from patches/unapplied/server/0744-Expand-PlayerItemDamageEvent.patch rename to patches/server/0717-Expand-PlayerItemDamageEvent.patch index bb173a36a5..fd1ce3f273 100644 --- a/patches/unapplied/server/0744-Expand-PlayerItemDamageEvent.patch +++ b/patches/server/0717-Expand-PlayerItemDamageEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand PlayerItemDamageEvent diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index a8f1953da3a5684079fb0cdb88cb3caf72d43646..59c4550b4cb8b0317f5256efc9376265f4583b60 100644 +index 2616a8fedcf67b395f1a7c9ef26ab7a34e38bb41..a80d225a7a4206acc4b93e328c96adf4411dad1d 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -640,10 +640,11 @@ public final class ItemStack { +@@ -653,10 +653,11 @@ public final class ItemStack implements DataComponentHolder { } } diff --git a/patches/server/0718-WorldCreator-keepSpawnLoaded.patch b/patches/server/0718-WorldCreator-keepSpawnLoaded.patch new file mode 100644 index 0000000000..94686907f3 --- /dev/null +++ b/patches/server/0718-WorldCreator-keepSpawnLoaded.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sat, 3 Jul 2021 21:18:28 +0100 +Subject: [PATCH] WorldCreator#keepSpawnLoaded + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 27072040887df4ff117179cfa5e7a39ef27c7501..70de655fd319863260bbfb0316fad892ba2f4af0 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -1308,6 +1308,14 @@ public final class CraftServer implements Server { + internal.setSpawnSettings(true, true); + // Paper - Put world into worldlist before initing the world; move up + ++ // Paper start ++ if (creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory())) { ++ GameRules.IntegerValue rule = internal.getGameRules().getRule(GameRules.RULE_SPAWN_CHUNK_RADIUS); ++ rule.deserialize("0"); ++ rule.onChanged(internal); ++ } ++ // Paper end ++ + this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal); + internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API + diff --git a/patches/unapplied/server/0746-Fix-CME-in-CraftPersistentDataTypeRegistry.patch b/patches/server/0719-Fix-CME-in-CraftPersistentDataTypeRegistry.patch similarity index 100% rename from patches/unapplied/server/0746-Fix-CME-in-CraftPersistentDataTypeRegistry.patch rename to patches/server/0719-Fix-CME-in-CraftPersistentDataTypeRegistry.patch diff --git a/patches/unapplied/server/0747-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch b/patches/server/0720-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch similarity index 91% rename from patches/unapplied/server/0747-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch rename to patches/server/0720-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch index 9606b571be..d77a04a7b5 100644 --- a/patches/unapplied/server/0747-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch +++ b/patches/server/0720-Trigger-bee_nest_destroyed-trigger-in-the-correct-pl.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Trigger bee_nest_destroyed trigger in the correct place diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 4fe571915b247ec612b2376dce57991e441f63c2..8f4c9b99b638cfce8cc7c55f6369f62e757f4e48 100644 +index f080322bc766361b9d2d8b1214c3dff1c3df9ae8..d8c5f8e584976a97bd909bfa20023993ab776952 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -421,12 +421,16 @@ public class ServerPlayerGameMode { +@@ -424,12 +424,16 @@ public class ServerPlayerGameMode { block.destroy(this.level, pos, iblockdata1); } @@ -25,7 +25,7 @@ index 4fe571915b247ec612b2376dce57991e441f63c2..8f4c9b99b638cfce8cc7c55f6369f62e itemstack.mineBlock(this.level, iblockdata1, pos, this.player); if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items -@@ -447,6 +451,13 @@ public class ServerPlayerGameMode { +@@ -450,6 +454,13 @@ public class ServerPlayerGameMode { if (flag && event != null) { iblockdata.getBlock().popExperience(this.level, pos, event.getExpToDrop(), this.player); // Paper } @@ -40,7 +40,7 @@ index 4fe571915b247ec612b2376dce57991e441f63c2..8f4c9b99b638cfce8cc7c55f6369f62e return true; // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java -index 27f1c1ac12251f1438ee8bf14f4afb5fe601138f..799e44ae5a7c3d6994653d43d455c39f3e30b012 100644 +index 7b311f60ceae9942eeee0d2c7a170278e5983f2d..4e8bafa97127632799a1f0260c1ef3367cb8a54c 100644 --- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java @@ -95,7 +95,7 @@ public class BeehiveBlock extends BaseEntityBlock { diff --git a/patches/unapplied/server/0748-Add-EntityDyeEvent-and-CollarColorable-interface.patch b/patches/server/0721-Add-EntityDyeEvent-and-CollarColorable-interface.patch similarity index 75% rename from patches/unapplied/server/0748-Add-EntityDyeEvent-and-CollarColorable-interface.patch rename to patches/server/0721-Add-EntityDyeEvent-and-CollarColorable-interface.patch index 758be4b481..08297a98bf 100644 --- a/patches/unapplied/server/0748-Add-EntityDyeEvent-and-CollarColorable-interface.patch +++ b/patches/server/0721-Add-EntityDyeEvent-and-CollarColorable-interface.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add EntityDyeEvent and CollarColorable interface diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index 7dfd2b17e82a80683af28779d0bd8f64a909c3b6..1d0c424be2b67cad0f8bca85070a9c46a6b283da 100644 +index d2e273f58b4c9b65642980d3f47e01ae92166e46..57c22ca91e9f3a161f5277914e379ea9dc8eeeef 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -402,6 +402,13 @@ public class Cat extends TamableAnimal implements VariantHolder { - DyeColor enumcolor = ((DyeItem) item).getDyeColor(); +@@ -388,6 +388,13 @@ public class Cat extends TamableAnimal implements VariantHolder -Date: Sat, 3 Jul 2021 21:18:28 +0100 -Subject: [PATCH] WorldCreator#keepSpawnLoaded - - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 713d36b8bcb3f39f7f0cff61532199416970bcf4..f3b461baac5a5de61f6b1c00251961bd25eb4773 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1290,7 +1290,7 @@ public final class CraftServer implements Server { - - ServerLevel internal = (ServerLevel) new ServerLevel(this.console, this.console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11), - worlddata.isDebugWorld(), j, creator.environment() == Environment.NORMAL ? list : ImmutableList.of(), true, this.console.overworld().getRandomSequences(), creator.environment(), generator, biomeProvider); -- internal.keepSpawnInMemory = creator.keepSpawnInMemory(); -+ // internal.keepSpawnInMemory = creator.keepSpawnInMemory(); // Paper - replace - - if (!(this.worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) { - return null; -@@ -1302,6 +1302,7 @@ public final class CraftServer implements Server { - internal.setSpawnSettings(true, true); - // Paper - Put world into worldlist before initing the world; move up - -+ internal.keepSpawnInMemory = creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory()); // Paper - this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal); - internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API -