From d52e2d241da502ffc14b2097e9b6d784a01e899b Mon Sep 17 00:00:00 2001 From: Noah van der Aa Date: Wed, 23 Oct 2024 23:35:21 +0200 Subject: [PATCH] MOOOOOOOORE --- ...x-plugin-loggers-on-server-shutdown.patch} | 6 +- ...ok-changes-from-crashing-the-server.patch} | 14 +- ...tityChangeBlockEvent-in-more-places.patch} | 85 +++++----- .../0732-Missing-eating-regain-reason.patch} | 14 +- .../server/0733-Missing-effect-cause.patch | 19 +++ ...serialization-deserialization-for-P.patch} | 0 ...5-Call-BlockPhysicsEvent-more-often.patch} | 14 +- ...0736-Configurable-chat-thread-limit.patch} | 0 ...of-WorldCreator-keepSpawnLoaded-ret.patch} | 0 .../0738-fix-Jigsaw-block-kicking-user.patch} | 8 +- ...mEvent-for-mud-converting-into-clay.patch} | 4 +- .../0740-Add-getDrops-to-BlockState.patch} | 0 .../0741-Fix-a-bunch-of-vanilla-bugs.patch} | 153 +++++++----------- ...y-onTrackingStart-during-navigation.patch} | 6 +- .../0743-Fix-custom-piglin-loved-items.patch} | 4 +- .../0744-EntityPickupItemEvent-fixes.patch | 73 +++++++++ ...interactions-with-items-on-cooldown.patch} | 14 +- ...-Add-PlayerInventorySlotChangeEvent.patch} | 8 +- .../0747-Elder-Guardian-appearance-API.patch} | 4 +- .../0748-Add-entity-knockback-API.patch} | 4 +- .../0749-Detect-headless-JREs.patch} | 2 +- ...-vehicle-collision-event-not-called.patch} | 8 +- .../0751-Add-EntityToggleSitEvent.patch} | 26 +-- .../0752-Add-fire-tick-delay-option.patch} | 2 +- .../0753-Add-Moving-Piston-API.patch} | 0 .../0754-Ignore-impossible-spawn-tick.patch} | 2 +- ...t-and-EntitySelectorParser-permissi.patch} | 0 ...Event-cancellation-cant-fully-preve.patch} | 8 +- ...0757-Add-PrePlayerAttackEntityEvent.patch} | 6 +- ...e-reset-EnderDragon-boss-event-name.patch} | 8 +- .../0759-Add-Player-Warden-Warning-API.patch} | 4 +- ...a-friendly-methods-to-update-trades.patch} | 10 +- ...761-Add-paper-dumplisteners-command.patch} | 0 .../server/0737-Missing-effect-cause.patch | 58 ------- .../0748-EntityPickupItemEvent-fixes.patch | 73 --------- todo.txt | 1 - 36 files changed, 281 insertions(+), 357 deletions(-) rename patches/{unapplied/server/0733-Fix-plugin-loggers-on-server-shutdown.patch => server/0729-Fix-plugin-loggers-on-server-shutdown.patch} (90%) rename patches/{unapplied/server/0734-Stop-large-look-changes-from-crashing-the-server.patch => server/0730-Stop-large-look-changes-from-crashing-the-server.patch} (85%) rename patches/{unapplied/server/0735-Fire-EntityChangeBlockEvent-in-more-places.patch => server/0731-Fire-EntityChangeBlockEvent-in-more-places.patch} (83%) rename patches/{unapplied/server/0736-Missing-eating-regain-reason.patch => server/0732-Missing-eating-regain-reason.patch} (78%) create mode 100644 patches/server/0733-Missing-effect-cause.patch rename patches/{unapplied/server/0738-Added-byte-array-serialization-deserialization-for-P.patch => server/0734-Added-byte-array-serialization-deserialization-for-P.patch} (100%) rename patches/{unapplied/server/0739-Call-BlockPhysicsEvent-more-often.patch => server/0735-Call-BlockPhysicsEvent-more-often.patch} (77%) rename patches/{unapplied/server/0740-Configurable-chat-thread-limit.patch => server/0736-Configurable-chat-thread-limit.patch} (100%) rename patches/{unapplied/server/0741-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch => server/0737-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch} (100%) rename patches/{unapplied/server/0742-fix-Jigsaw-block-kicking-user.patch => server/0738-fix-Jigsaw-block-kicking-user.patch} (80%) rename patches/{unapplied/server/0743-use-BlockFormEvent-for-mud-converting-into-clay.patch => server/0739-use-BlockFormEvent-for-mud-converting-into-clay.patch} (92%) rename patches/{unapplied/server/0744-Add-getDrops-to-BlockState.patch => server/0740-Add-getDrops-to-BlockState.patch} (100%) rename patches/{unapplied/server/0745-Fix-a-bunch-of-vanilla-bugs.patch => server/0741-Fix-a-bunch-of-vanilla-bugs.patch} (72%) rename patches/{unapplied/server/0746-Remove-unnecessary-onTrackingStart-during-navigation.patch => server/0742-Remove-unnecessary-onTrackingStart-during-navigation.patch} (84%) rename patches/{unapplied/server/0747-Fix-custom-piglin-loved-items.patch => server/0743-Fix-custom-piglin-loved-items.patch} (90%) create mode 100644 patches/server/0744-EntityPickupItemEvent-fixes.patch rename patches/{unapplied/server/0749-Correctly-handle-interactions-with-items-on-cooldown.patch => server/0745-Correctly-handle-interactions-with-items-on-cooldown.patch} (87%) rename patches/{unapplied/server/0750-Add-PlayerInventorySlotChangeEvent.patch => server/0746-Add-PlayerInventorySlotChangeEvent.patch} (91%) rename patches/{unapplied/server/0751-Elder-Guardian-appearance-API.patch => server/0747-Elder-Guardian-appearance-API.patch} (84%) rename patches/{unapplied/server/0752-Add-entity-knockback-API.patch => server/0748-Add-entity-knockback-API.patch} (86%) rename patches/{unapplied/server/0753-Detect-headless-JREs.patch => server/0749-Detect-headless-JREs.patch} (96%) rename patches/{unapplied/server/0754-fix-entity-vehicle-collision-event-not-called.patch => server/0750-fix-entity-vehicle-collision-event-not-called.patch} (79%) rename patches/{unapplied/server/0755-Add-EntityToggleSitEvent.patch => server/0751-Add-EntityToggleSitEvent.patch} (79%) rename patches/{unapplied/server/0756-Add-fire-tick-delay-option.patch => server/0752-Add-fire-tick-delay-option.patch} (95%) rename patches/{unapplied/server/0757-Add-Moving-Piston-API.patch => server/0753-Add-Moving-Piston-API.patch} (100%) rename patches/{unapplied/server/0758-Ignore-impossible-spawn-tick.patch => server/0754-Ignore-impossible-spawn-tick.patch} (90%) rename patches/{unapplied/server/0759-Fix-EntityArgument-and-EntitySelectorParser-permissi.patch => server/0755-Fix-EntityArgument-and-EntitySelectorParser-permissi.patch} (100%) rename patches/{unapplied/server/0760-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch => server/0756-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch} (84%) rename patches/{unapplied/server/0761-Add-PrePlayerAttackEntityEvent.patch => server/0757-Add-PrePlayerAttackEntityEvent.patch} (81%) rename patches/{unapplied/server/0762-ensure-reset-EnderDragon-boss-event-name.patch => server/0758-ensure-reset-EnderDragon-boss-event-name.patch} (89%) rename patches/{unapplied/server/0763-Add-Player-Warden-Warning-API.patch => server/0759-Add-Player-Warden-Warning-API.patch} (93%) rename patches/{unapplied/server/0764-More-vanilla-friendly-methods-to-update-trades.patch => server/0760-More-vanilla-friendly-methods-to-update-trades.patch} (90%) rename patches/{unapplied/server/0765-Add-paper-dumplisteners-command.patch => server/0761-Add-paper-dumplisteners-command.patch} (100%) delete mode 100644 patches/unapplied/server/0737-Missing-effect-cause.patch delete mode 100644 patches/unapplied/server/0748-EntityPickupItemEvent-fixes.patch delete mode 100644 todo.txt diff --git a/patches/unapplied/server/0733-Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/0729-Fix-plugin-loggers-on-server-shutdown.patch similarity index 90% rename from patches/unapplied/server/0733-Fix-plugin-loggers-on-server-shutdown.patch rename to patches/server/0729-Fix-plugin-loggers-on-server-shutdown.patch index 4a610485e6..6c058f039b 100644 --- a/patches/unapplied/server/0733-Fix-plugin-loggers-on-server-shutdown.patch +++ b/patches/server/0729-Fix-plugin-loggers-on-server-shutdown.patch @@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 11b9eb8d7d5f9ad736f2c6784c5d9e745a355093..bef05e09c654794405832ad75c3471f63399dfee 100644 +index 2101c0a3b000a60733ceada248c202e2c4783af5..027d94dd08e7789b51c8779c65d4ddad4e62f21a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1237,6 +1237,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 5383d231748f2d30b2f2bf3ce07d3667e4d828e9..e6d20887572817099cb863515978d3f06926be3d 100644 +index 682d0399b9b3729d16978eca258c55c2150afec7..16f349f8ce621c58f36f445016ea25d8af14910d 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3158,37 +3158,15 @@ public abstract class LivingEntity extends Entity implements Attackable { - this.level().getProfiler().pop(); - this.level().getProfiler().push("rangeChecks"); +@@ -3272,37 +3272,15 @@ public abstract class LivingEntity extends Entity implements Attackable { + gameprofilerfiller.pop(); + gameprofilerfiller.push("rangeChecks"); - while (this.getYRot() - this.yRotO < -180.0F) { - this.yRotO -= 360.0F; @@ -51,13 +51,13 @@ index 5383d231748f2d30b2f2bf3ce07d3667e4d828e9..e6d20887572817099cb863515978d3f0 + this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F; + // Paper end - this.level().getProfiler().pop(); + gameprofilerfiller.pop(); this.animStep += f2; diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 06ca07edef062f21c51860146086297ca345104d..63ffa02f820d88f865ae604712edcf2ac13f0bff 100644 +index 846a108af8bacdcaf3a17db9fb808965ce2581bb..4d487090a622d280bdfacc18978929c61f74f147 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -313,13 +313,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -428,13 +428,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { } protected static float lerpRotation(float prevRot, float newRot) { diff --git a/patches/unapplied/server/0735-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0731-Fire-EntityChangeBlockEvent-in-more-places.patch similarity index 83% rename from patches/unapplied/server/0735-Fire-EntityChangeBlockEvent-in-more-places.patch rename to patches/server/0731-Fire-EntityChangeBlockEvent-in-more-places.patch index bafa064971..3fab5db628 100644 --- a/patches/unapplied/server/0735-Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/0731-Fire-EntityChangeBlockEvent-in-more-places.patch @@ -7,23 +7,18 @@ Co-authored-by: ChristopheG <61288881+chrisgdt@users.noreply.github.com> Co-authored-by: maxcom1 <46265094+maxcom1@users.noreply.github.com> diff --git a/src/main/java/net/minecraft/world/effect/WeavingMobEffect.java b/src/main/java/net/minecraft/world/effect/WeavingMobEffect.java -index 6a84eaeddd0d7f050053c8aa0659d6811192aad4..1b2d41a6c6f149701c8a78f3d345f45069f1f857 100644 +index e311f94918fb03e9d202cbae71b0909ea3219180..d090126dbe6b69489490e6b1e2d443fa171ddde6 100644 --- a/src/main/java/net/minecraft/world/effect/WeavingMobEffect.java +++ b/src/main/java/net/minecraft/world/effect/WeavingMobEffect.java -@@ -25,11 +25,11 @@ class WeavingMobEffect extends MobEffect { +@@ -25,7 +25,7 @@ class WeavingMobEffect extends MobEffect { @Override - public void onMobRemoved(LivingEntity entity, int amplifier, Entity.RemovalReason reason) { - if (reason == Entity.RemovalReason.KILLED && (entity instanceof Player || entity.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { -- this.spawnCobwebsRandomlyAround(entity.level(), entity.getRandom(), entity.getOnPos()); -+ this.spawnCobwebsRandomlyAround(entity, entity.level(), entity.getRandom(), entity.getOnPos()); // Paper - Fire EntityChangeBlockEvent in more places + public void onMobRemoved(ServerLevel world, LivingEntity entity, int amplifier, Entity.RemovalReason reason) { + if (reason == Entity.RemovalReason.KILLED && (entity instanceof Player || world.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING))) { +- this.spawnCobwebsRandomlyAround(world, entity.getRandom(), entity.blockPosition()); ++ this.spawnCobwebsRandomlyAround(entity, world, entity.getRandom(), entity.blockPosition()); // Paper - Fire EntityChangeBlockEvent in more places } } -- private void spawnCobwebsRandomlyAround(Level world, RandomSource random, BlockPos pos) { -+ private void spawnCobwebsRandomlyAround(LivingEntity entity, Level world, RandomSource random, BlockPos pos) { // Paper - Fire EntityChangeBlockEvent in more places - Set set = Sets.newHashSet(); - int i = this.maxCobwebs.applyAsInt(random); - @@ -46,6 +46,7 @@ class WeavingMobEffect extends MobEffect { } @@ -33,10 +28,10 @@ index 6a84eaeddd0d7f050053c8aa0659d6811192aad4..1b2d41a6c6f149701c8a78f3d345f450 world.levelEvent(3018, blockPos3, 0); } diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java -index bf5015c4bb68e5c46313bab1e59c0a4d45053b73..0471d9c85af02133f99cca4e181b83b58a3f1abc 100644 +index 2b09e9efad198ff596d88f97d703a8a00c108608..152ecd38814089333b8d61538297ce720756d2c3 100644 --- a/src/main/java/net/minecraft/world/entity/LightningBolt.java +++ b/src/main/java/net/minecraft/world/entity/LightningBolt.java -@@ -99,7 +99,7 @@ public class LightningBolt extends Entity { +@@ -98,7 +98,7 @@ public class LightningBolt extends Entity { } this.powerLightningRod(); @@ -45,8 +40,8 @@ index bf5015c4bb68e5c46313bab1e59c0a4d45053b73..0471d9c85af02133f99cca4e181b83b5 this.gameEvent(GameEvent.LIGHTNING_STRIKE); } } -@@ -193,7 +193,7 @@ public class LightningBolt extends Entity { - } +@@ -202,7 +202,7 @@ public class LightningBolt extends Entity { + } - private static void clearCopperOnLightningStrike(Level world, BlockPos pos) { @@ -54,7 +49,7 @@ index bf5015c4bb68e5c46313bab1e59c0a4d45053b73..0471d9c85af02133f99cca4e181b83b5 BlockState iblockdata = world.getBlockState(pos); BlockPos blockposition1; BlockState iblockdata1; -@@ -207,24 +207,29 @@ public class LightningBolt extends Entity { +@@ -216,24 +216,29 @@ public class LightningBolt extends Entity { } if (iblockdata1.getBlock() instanceof WeatheringCopper) { @@ -88,7 +83,7 @@ index bf5015c4bb68e5c46313bab1e59c0a4d45053b73..0471d9c85af02133f99cca4e181b83b5 if (optional.isEmpty()) { break; -@@ -235,7 +240,7 @@ public class LightningBolt extends Entity { +@@ -244,7 +249,7 @@ public class LightningBolt extends Entity { } @@ -97,7 +92,7 @@ index bf5015c4bb68e5c46313bab1e59c0a4d45053b73..0471d9c85af02133f99cca4e181b83b5 Iterator iterator = BlockPos.randomInCube(world.random, 10, pos, 1).iterator(); BlockPos blockposition1; -@@ -252,6 +257,7 @@ public class LightningBolt extends Entity { +@@ -261,6 +266,7 @@ public class LightningBolt extends Entity { BlockPos blockposition1Final = blockposition1; // CraftBukkit - decompile error WeatheringCopper.getPrevious(iblockdata).ifPresent((iblockdata1) -> { @@ -106,10 +101,10 @@ index bf5015c4bb68e5c46313bab1e59c0a4d45053b73..0471d9c85af02133f99cca4e181b83b5 }); world.levelEvent(3002, blockposition1, -1); diff --git a/src/main/java/net/minecraft/world/item/AxeItem.java b/src/main/java/net/minecraft/world/item/AxeItem.java -index c227784544e52ee2c75ab1a2181e0b0ba7246f4b..f005ea92449cf5e249ff64f4791c3bc6b8635528 100644 +index 74c9966093377b67e31b50483c2f24b70734faf6..abff08f2d61014944235ffe2f5494a718a28cc10 100644 --- a/src/main/java/net/minecraft/world/item/AxeItem.java +++ b/src/main/java/net/minecraft/world/item/AxeItem.java -@@ -65,6 +65,11 @@ public class AxeItem extends DiggerItem { +@@ -67,6 +67,11 @@ public class AxeItem extends DiggerItem { return InteractionResult.PASS; } else { ItemStack itemStack = context.getItemInHand(); @@ -122,10 +117,10 @@ index c227784544e52ee2c75ab1a2181e0b0ba7246f4b..f005ea92449cf5e249ff64f4791c3bc6 CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack); } diff --git a/src/main/java/net/minecraft/world/item/EnderEyeItem.java b/src/main/java/net/minecraft/world/item/EnderEyeItem.java -index 391579b515c5a07066f82b33c4f9ef8ee1d05530..d8ce44a180f848f4c9c04967470c4359af979b2f 100644 +index 770467bd319f8e2fdf3d713591368aa825cfa5ae..b00a2fe4cefff26b65789829777b25bbc8e024fa 100644 --- a/src/main/java/net/minecraft/world/item/EnderEyeItem.java +++ b/src/main/java/net/minecraft/world/item/EnderEyeItem.java -@@ -46,6 +46,11 @@ public class EnderEyeItem extends Item { +@@ -45,6 +45,11 @@ public class EnderEyeItem extends Item { return InteractionResult.SUCCESS; } else { BlockState iblockdata1 = (BlockState) iblockdata.setValue(EndPortalFrameBlock.HAS_EYE, true); @@ -138,7 +133,7 @@ index 391579b515c5a07066f82b33c4f9ef8ee1d05530..d8ce44a180f848f4c9c04967470c4359 Block.pushEntitiesUp(iblockdata, iblockdata1, world, blockposition); world.setBlock(blockposition, iblockdata1, 2); diff --git a/src/main/java/net/minecraft/world/item/HoneycombItem.java b/src/main/java/net/minecraft/world/item/HoneycombItem.java -index decabf6fccaca3d1bfeba679ac71677d33315f5e..14d37bf64af719eae3ea154ea7f952cc27712b57 100644 +index 6c0fe41692c9d1fa50a4f421eb4735860a9ae0e9..d7924825823b2bf79ca3a26272de11ff8d2ec74c 100644 --- a/src/main/java/net/minecraft/world/item/HoneycombItem.java +++ b/src/main/java/net/minecraft/world/item/HoneycombItem.java @@ -74,6 +74,14 @@ public class HoneycombItem extends Item implements SignApplicator { @@ -153,28 +148,28 @@ index decabf6fccaca3d1bfeba679ac71677d33315f5e..14d37bf64af719eae3ea154ea7f952cc + return InteractionResult.PASS; + } + // Paper end - if (player instanceof ServerPlayer) { - CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger((ServerPlayer)player, blockPos, itemStack); + if (player instanceof ServerPlayer serverPlayer) { + CriteriaTriggers.ITEM_USED_ON_BLOCK.trigger(serverPlayer, blockPos, itemStack); } diff --git a/src/main/java/net/minecraft/world/item/PotionItem.java b/src/main/java/net/minecraft/world/item/PotionItem.java -index 92fa6523f2bba105a74fff228e36e58666ed56ae..d147b24bb57b322d3f5f4a9eb8cfef2acdd9e0f5 100644 +index 1c8fd643c32226d72d51abc869a49e256dd2432b..627439c3aa8171e9a54dbcb8842af50cc58f7f23 100644 --- a/src/main/java/net/minecraft/world/item/PotionItem.java +++ b/src/main/java/net/minecraft/world/item/PotionItem.java -@@ -109,6 +109,12 @@ public class PotionItem extends Item { - BlockState iblockdata = world.getBlockState(blockposition); - - if (context.getClickedFace() != Direction.DOWN && iblockdata.is(BlockTags.CONVERTABLE_TO_MUD) && potioncontents.is(Potions.WATER)) { +@@ -42,6 +42,12 @@ public class PotionItem extends Item { + PotionContents potionContents = itemStack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY); + BlockState blockState = level.getBlockState(blockPos); + if (context.getClickedFace() != Direction.DOWN && blockState.is(BlockTags.CONVERTABLE_TO_MUD) && potionContents.is(Potions.WATER)) { + // Paper start + if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityhuman, blockposition, Blocks.MUD.defaultBlockState())) { + entityhuman.containerMenu.sendAllDataToRemote(); + return InteractionResult.PASS; + } + // Paper end - world.playSound((Player) null, blockposition, SoundEvents.GENERIC_SPLASH, SoundSource.BLOCKS, 1.0F, 1.0F); - entityhuman.setItemInHand(context.getHand(), ItemUtils.createFilledResult(itemstack, entityhuman, new ItemStack(Items.GLASS_BOTTLE))); - entityhuman.awardStat(Stats.ITEM_USED.get(itemstack.getItem())); + level.playSound(null, blockPos, SoundEvents.GENERIC_SPLASH, SoundSource.BLOCKS, 1.0F, 1.0F); + player.setItemInHand(context.getHand(), ItemUtils.createFilledResult(itemStack, player, new ItemStack(Items.GLASS_BOTTLE))); + player.awardStat(Stats.ITEM_USED.get(itemStack.getItem())); diff --git a/src/main/java/net/minecraft/world/item/ShovelItem.java b/src/main/java/net/minecraft/world/item/ShovelItem.java -index c0e96284bb470353c0e54ad4e0c2205017913e61..24f6a158e4759aac3be8da4cf5e0d40bd295355b 100644 +index c0377341227e8f4f1f7b1448580b3c7bc1b65f48..55c18f182166f4905d623d6f5e909eefd5ed2483 100644 --- a/src/main/java/net/minecraft/world/item/ShovelItem.java +++ b/src/main/java/net/minecraft/world/item/ShovelItem.java @@ -46,20 +46,29 @@ public class ShovelItem extends DiggerItem { @@ -209,10 +204,10 @@ index c0e96284bb470353c0e54ad4e0c2205017913e61..24f6a158e4759aac3be8da4cf5e0d40b level.gameEvent(GameEvent.BLOCK_CHANGE, blockPos, GameEvent.Context.of(player, blockState3)); if (player != null) { diff --git a/src/main/java/net/minecraft/world/level/block/CakeBlock.java b/src/main/java/net/minecraft/world/level/block/CakeBlock.java -index d72f4a01ca07df8a9678b3ca4707e5363e482283..43e306b5ef00b39923c1597f212b4a07fb95f1ca 100644 +index 7629b9212ded7155e94f67ca429f62271e5f5aa0..1104f620a050555f71d058711cc34fadb964222f 100644 --- a/src/main/java/net/minecraft/world/level/block/CakeBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CakeBlock.java -@@ -65,6 +65,12 @@ public class CakeBlock extends Block { +@@ -66,6 +66,12 @@ public class CakeBlock extends Block { if (block instanceof CandleBlock) { CandleBlock candleblock = (CandleBlock) block; @@ -225,7 +220,7 @@ index d72f4a01ca07df8a9678b3ca4707e5363e482283..43e306b5ef00b39923c1597f212b4a07 stack.consume(1, player); world.playSound((Player) null, pos, SoundEvents.CAKE_ADD_CANDLE, SoundSource.BLOCKS, 1.0F, 1.0F); world.setBlockAndUpdate(pos, CandleCakeBlock.byCandle(candleblock)); -@@ -96,6 +102,14 @@ public class CakeBlock extends Block { +@@ -97,6 +103,14 @@ public class CakeBlock extends Block { if (!player.canEat(false)) { return InteractionResult.PASS; } else { @@ -240,7 +235,7 @@ index d72f4a01ca07df8a9678b3ca4707e5363e482283..43e306b5ef00b39923c1597f212b4a07 player.awardStat(Stats.EAT_CAKE_SLICE); // CraftBukkit start // entityhuman.getFoodData().eat(2, 0.1F); -@@ -109,7 +123,7 @@ public class CakeBlock extends Block { +@@ -110,7 +124,7 @@ public class CakeBlock extends Block { ((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity().sendHealthUpdate(); // CraftBukkit end @@ -250,10 +245,10 @@ index d72f4a01ca07df8a9678b3ca4707e5363e482283..43e306b5ef00b39923c1597f212b4a07 world.gameEvent((Entity) player, (Holder) GameEvent.EAT, pos); if (i < 6) { diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -index 804adb5ed92dfcf4c29c756dd95d7164150a9666..19fa8a9f935e9063497f8c0bd7909036fa0af2b7 100644 +index 2bcd246a26dad560cf69682b29983d320ebf1884..60bf63c2cff3ce8a1892ba5c2303738c35b83d79 100644 --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -@@ -239,6 +239,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -243,6 +243,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { if (i < 8 && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem())) { if (i < 7 && !world.isClientSide) { BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, stack); @@ -265,7 +260,7 @@ index 804adb5ed92dfcf4c29c756dd95d7164150a9666..19fa8a9f935e9063497f8c0bd7909036 world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0); player.awardStat(Stats.ITEM_USED.get(stack.getItem())); -@@ -269,11 +274,16 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -273,11 +278,16 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { if (i < 7 && ComposterBlock.COMPOSTABLES.containsKey(stack.getItem())) { // CraftBukkit start double rand = world.getRandom().nextDouble(); @@ -284,7 +279,7 @@ index 804adb5ed92dfcf4c29c756dd95d7164150a9666..19fa8a9f935e9063497f8c0bd7909036 // CraftBukkit end stack.shrink(1); -@@ -314,11 +324,13 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -318,11 +328,13 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { return iblockdata1; } @@ -298,7 +293,7 @@ index 804adb5ed92dfcf4c29c756dd95d7164150a9666..19fa8a9f935e9063497f8c0bd7909036 static BlockState addItem(@Nullable Entity entity, BlockState iblockdata, LevelAccessor generatoraccess, BlockPos blockposition, ItemStack itemstack, double rand) { // CraftBukkit end int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL); -@@ -329,6 +341,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { +@@ -333,6 +345,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { } else { int j = i + 1; BlockState iblockdata1 = (BlockState) iblockdata.setValue(ComposterBlock.LEVEL, j); @@ -311,10 +306,10 @@ index 804adb5ed92dfcf4c29c756dd95d7164150a9666..19fa8a9f935e9063497f8c0bd7909036 generatoraccess.setBlock(blockposition, iblockdata1, 3); generatoraccess.gameEvent((Holder) GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entity, iblockdata1)); diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index ef8a0236ab4fb648c4bb2a8cfc90e3cefe8f9f1d..1a3d8755c8f6a7cfe06069e2082d8147aaaff097 100644 +index 8224d5bddb7f7893dee09222a673af54791abcfa..f8828dc8334af19d7b2118e8cf34d94be5e09ee8 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -@@ -259,7 +259,13 @@ public class BeehiveBlockEntity extends BlockEntity { +@@ -260,7 +260,13 @@ public class BeehiveBlockEntity extends BlockEntity { --j; } diff --git a/patches/unapplied/server/0736-Missing-eating-regain-reason.patch b/patches/server/0732-Missing-eating-regain-reason.patch similarity index 78% rename from patches/unapplied/server/0736-Missing-eating-regain-reason.patch rename to patches/server/0732-Missing-eating-regain-reason.patch index af804e161b..38626b6352 100644 --- a/patches/unapplied/server/0736-Missing-eating-regain-reason.patch +++ b/patches/server/0732-Missing-eating-regain-reason.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Missing eating regain reason 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 2ed442c8d36f285420cf84a956e90b6036384ce0..23d4dcc82115fd1a0a77565a0472304042d5f12d 100644 +index bffc7c21727a6e5ff13a498aa51f6797e4d6d596..471d5727b964922d8e898be9e1d5c30f9d3bac97 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -398,7 +398,7 @@ public class Cat extends TamableAnimal implements VariantHolder 0.0F) { diff --git a/patches/server/0733-Missing-effect-cause.patch b/patches/server/0733-Missing-effect-cause.patch new file mode 100644 index 0000000000..6157121022 --- /dev/null +++ b/patches/server/0733-Missing-effect-cause.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> +Date: Tue, 16 Aug 2022 19:44:55 +0200 +Subject: [PATCH] Missing effect cause + + +diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +index 068d96cd0bceec79f14fbf3289eeb81533d1ba22..31b10cd404b672d7ce21c2107d8f83e32de26ef4 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java ++++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java +@@ -424,7 +424,7 @@ public class Axolotl extends Animal implements VariantHolder, B + player.addEffect(new MobEffectInstance(MobEffects.REGENERATION, j, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AXOLOTL); // CraftBukkit + } + +- player.removeEffect(MobEffects.DIG_SLOWDOWN); ++ player.removeEffect(MobEffects.DIG_SLOWDOWN, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AXOLOTL); // Paper - Add missing effect cause + } + + @Override diff --git a/patches/unapplied/server/0738-Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/0734-Added-byte-array-serialization-deserialization-for-P.patch similarity index 100% rename from patches/unapplied/server/0738-Added-byte-array-serialization-deserialization-for-P.patch rename to patches/server/0734-Added-byte-array-serialization-deserialization-for-P.patch diff --git a/patches/unapplied/server/0739-Call-BlockPhysicsEvent-more-often.patch b/patches/server/0735-Call-BlockPhysicsEvent-more-often.patch similarity index 77% rename from patches/unapplied/server/0739-Call-BlockPhysicsEvent-more-often.patch rename to patches/server/0735-Call-BlockPhysicsEvent-more-often.patch index 1839fbe711..ad24091f87 100644 --- a/patches/unapplied/server/0739-Call-BlockPhysicsEvent-more-often.patch +++ b/patches/server/0735-Call-BlockPhysicsEvent-more-often.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Call BlockPhysicsEvent more often diff --git a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java -index 457a963ee6ebd3cf5c3831f6660e3850335af49f..106af2b2c7ff72c7549975aef75cdcff8d9a7d97 100644 +index 5821c802ec880501df025fcd3fbbd98242ed952c..0587f4e5083a6c890a11642284a9c16fb2eb2fe1 100644 --- a/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java +++ b/src/main/java/net/minecraft/world/level/redstone/CollectingNeighborUpdater.java -@@ -119,7 +119,20 @@ public class CollectingNeighborUpdater implements NeighborUpdater { - public boolean runNext(Level world) { - BlockPos blockPos = this.sourcePos.relative(NeighborUpdater.UPDATE_ORDER[this.idx++]); - BlockState blockState = world.getBlockState(blockPos); -- NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, this.sourcePos, false); +@@ -135,7 +135,20 @@ public class CollectingNeighborUpdater implements NeighborUpdater { + orientation = this.orientation.withFront(direction); + } + +- NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, orientation, false); + // Paper start - Call BlockPhysicsEvent + try { + org.bukkit.event.block.BlockPhysicsEvent event = new org.bukkit.event.block.BlockPhysicsEvent( @@ -21,7 +21,7 @@ index 457a963ee6ebd3cf5c3831f6660e3850335af49f..106af2b2c7ff72c7549975aef75cdcff + org.bukkit.craftbukkit.block.CraftBlock.at(world, this.sourcePos)); + + if (event.callEvent()) { // continue to check for adjacent block (increase idx) -+ NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, this.sourcePos, false); ++ NeighborUpdater.executeUpdate(world, blockState, blockPos, this.sourceBlock, orientation, false); + } + } catch (StackOverflowError ex) { + world.lastPhysicsProblem = blockPos; diff --git a/patches/unapplied/server/0740-Configurable-chat-thread-limit.patch b/patches/server/0736-Configurable-chat-thread-limit.patch similarity index 100% rename from patches/unapplied/server/0740-Configurable-chat-thread-limit.patch rename to patches/server/0736-Configurable-chat-thread-limit.patch diff --git a/patches/unapplied/server/0741-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/0737-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch similarity index 100% rename from patches/unapplied/server/0741-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch rename to patches/server/0737-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch diff --git a/patches/unapplied/server/0742-fix-Jigsaw-block-kicking-user.patch b/patches/server/0738-fix-Jigsaw-block-kicking-user.patch similarity index 80% rename from patches/unapplied/server/0742-fix-Jigsaw-block-kicking-user.patch rename to patches/server/0738-fix-Jigsaw-block-kicking-user.patch index 6e1aef94c8..a7960e5bc3 100644 --- a/patches/unapplied/server/0742-fix-Jigsaw-block-kicking-user.patch +++ b/patches/server/0738-fix-Jigsaw-block-kicking-user.patch @@ -5,14 +5,14 @@ Subject: [PATCH] fix Jigsaw block kicking user diff --git a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java -index 0083602f8c8826e247fecbdb5cdb6548ff6180ce..675f6b2932e036d2eedf065fd2db4bf9f0e4250d 100644 +index 42300114e3baf31fd26090fca3b497c8157d4bb9..8fda7f812ba266cf8051f6796d2c35cba197e904 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/JigsawBlockEntity.java -@@ -137,7 +137,12 @@ public class JigsawBlockEntity extends BlockEntity { +@@ -131,7 +131,12 @@ public class JigsawBlockEntity extends BlockEntity { public void generate(ServerLevel world, int maxDepth, boolean keepJigsaws) { BlockPos blockPos = this.getBlockPos().relative(this.getBlockState().getValue(JigsawBlock.ORIENTATION).front()); - Registry registry = world.registryAccess().registryOrThrow(Registries.TEMPLATE_POOL); -- Holder holder = registry.getHolderOrThrow(this.pool); + Registry registry = world.registryAccess().lookupOrThrow(Registries.TEMPLATE_POOL); +- Holder holder = registry.getOrThrow(this.pool); + // Paper start - Replace getHolderOrThrow with a null check + Holder holder = registry.getHolder(this.pool).orElse(null); + if (holder == null) { diff --git a/patches/unapplied/server/0743-use-BlockFormEvent-for-mud-converting-into-clay.patch b/patches/server/0739-use-BlockFormEvent-for-mud-converting-into-clay.patch similarity index 92% rename from patches/unapplied/server/0743-use-BlockFormEvent-for-mud-converting-into-clay.patch rename to patches/server/0739-use-BlockFormEvent-for-mud-converting-into-clay.patch index 8653ffd786..3159c4b594 100644 --- a/patches/unapplied/server/0743-use-BlockFormEvent-for-mud-converting-into-clay.patch +++ b/patches/server/0739-use-BlockFormEvent-for-mud-converting-into-clay.patch @@ -5,10 +5,10 @@ Subject: [PATCH] use BlockFormEvent for mud converting into clay 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 95cb7492ac691a8e8aa9894f701b802a7eda5446..a2bd54dae4b0460d200f6d5300194a7ef5a28830 100644 +index bd38a0a73d543a85bb5c6d50219f5438ce194df3..53cea36ec931de89e0060613acf87beb51dc16ec 100644 --- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java -@@ -215,10 +215,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate +@@ -219,10 +219,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate if (((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState.is(Blocks.MUD) && fluidtype == Fluids.WATER) { BlockState iblockdata1 = Blocks.CLAY.defaultBlockState(); diff --git a/patches/unapplied/server/0744-Add-getDrops-to-BlockState.patch b/patches/server/0740-Add-getDrops-to-BlockState.patch similarity index 100% rename from patches/unapplied/server/0744-Add-getDrops-to-BlockState.patch rename to patches/server/0740-Add-getDrops-to-BlockState.patch diff --git a/patches/unapplied/server/0745-Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/0741-Fix-a-bunch-of-vanilla-bugs.patch similarity index 72% rename from patches/unapplied/server/0745-Fix-a-bunch-of-vanilla-bugs.patch rename to patches/server/0741-Fix-a-bunch-of-vanilla-bugs.patch index 7813123f49..f21808be3a 100644 --- a/patches/unapplied/server/0745-Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/0741-Fix-a-bunch-of-vanilla-bugs.patch @@ -91,11 +91,11 @@ index 6854ca4d4fec2b4fa541c3fabf63787665572609..e7b444a10b244828827b3c66c5346520 } diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 071e9ef3680c5dc492c6142ccd05f6788ebc3035..61fda6927f060cdf8bcfddaaa08bbbe2c514c630 100644 +index 7f18146c0dea654c62b3e01e6848fd1c05f87946..1a724f9bb6ef82a0b5fdd9ade036d7365167f14b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1027,7 +1027,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider - // CraftBukkit end +@@ -1080,7 +1080,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider + } - boolean anyPlayerCloseEnoughForSpawning(ChunkPos pos) { @@ -104,12 +104,12 @@ index 071e9ef3680c5dc492c6142ccd05f6788ebc3035..61fda6927f060cdf8bcfddaaa08bbbe2 return this.anyPlayerCloseEnoughForSpawning(pos, false); } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index b88a7f580b4138ceb262f3d398e78fdc2e6b018c..1edad85fc5c199dcab66497fa758e48dd14aec8c 100644 +index 100661b77466152a651d22daa7df992c28fbbecb..79fabd52eb3a08ec9c9ab2ec5d6ff4a31a02a292 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -777,7 +777,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -764,7 +764,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } else { - AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D); + AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, blockposition1.atY(this.getMaxY() + 1)).inflate(3.0D); List list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> { - return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition()); + return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition()) && !entityliving.isSpectator(); // Paper - Fix lightning being able to hit spectators (MC-262422) @@ -117,10 +117,10 @@ index b88a7f580b4138ceb262f3d398e78fdc2e6b018c..1edad85fc5c199dcab66497fa758e48d if (!list.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 6abecaac8407b992d208a9108e11fd4954a4106f..03d89f326d320c5d778c3d1e2db7d6b88753faec 100644 +index 064a7a3e1c4d192010e072a5e985a54135748d87..a706f0855fdf88cc9aece3ba00ef574b9cd8bd11 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -93,7 +93,7 @@ public class ServerPlayerGameMode { +@@ -91,7 +91,7 @@ public class ServerPlayerGameMode { return event; // Paper - Expand PlayerGameModeChangeEvent } // CraftBukkit end @@ -130,23 +130,23 @@ index 6abecaac8407b992d208a9108e11fd4954a4106f..03d89f326d320c5d778c3d1e2db7d6b8 this.player.server.getPlayerList().broadcastAll(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_GAME_MODE, this.player), this.player); // CraftBukkit this.level.updateSleepingPlayerList(); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ca32e5aa6e77ca1bab886e7b6a778ec931ac4e4c..28808ffc6e486f7dc01be370c9eb249dc1f7ea46 100644 +index 5f567d6a8ac93113c2f57d38736c4891c5f9ae19..6c7c6cd7c071b722faf7ec06e022a6ad8b1ecc42 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1814,7 +1814,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - } else if (enuminteractionresult.shouldSwing() && !this.player.gameMode.interactResult) { // Paper - Call interact event - this.player.swing(enumhand, true); +@@ -1823,7 +1823,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl + this.player.swing(enumhand, true); + } } - } + } else { this.player.containerMenu.sendAllDataToRemote(); } // Paper - Fix inventory desync; MC-99075 } else { - MutableComponent ichatmutablecomponent1 = Component.translatable("build.tooHigh", i - 1).withStyle(ChatFormatting.RED); + MutableComponent ichatmutablecomponent1 = Component.translatable("build.tooHigh", i).withStyle(ChatFormatting.RED); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 03572023ae7f061bf34fed8ac27852e08d6412c0..38b9ab369e25e4b718418375f76e782283b48411 100644 +index f0ce0041497d038c55019e0f5a8e8b8619cec398..8e71eeb5be2df1352447f3662a6d092a7db9e2d0 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -260,7 +260,7 @@ public abstract class PlayerList { +@@ -261,7 +261,7 @@ public abstract class PlayerList { } if (optional.isEmpty() || invalidPlayerWorld[0]) { // Paper end - reset to main world spawn if first spawn or invalid world @@ -155,7 +155,7 @@ index 03572023ae7f061bf34fed8ac27852e08d6412c0..38b9ab369e25e4b718418375f76e7822 } // Paper end - Entity#getEntitySpawnReason player.setServerLevel(worldserver1); -@@ -703,8 +703,10 @@ public abstract class PlayerList { +@@ -661,8 +661,10 @@ public abstract class PlayerList { Player player = entity.getBukkitEntity(); PlayerLoginEvent event = new PlayerLoginEvent(player, loginlistener.connection.hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.connection.channel.remoteAddress()).getAddress()); @@ -169,10 +169,10 @@ index 03572023ae7f061bf34fed8ac27852e08d6412c0..38b9ab369e25e4b718418375f76e7822 ichatmutablecomponent = Component.translatable("multiplayer.disconnect.banned.reason", gameprofilebanentry.getReason()); if (gameprofilebanentry.getExpires() != null) { diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java -index 784a894688f98f9d0368a36d456c5c94e1ee3695..a85885ee51df585fa11ae9f8fcd67ff2a71c5a18 100644 +index 6827426e6e9706909265f84bf97b5fa7105a7fea..7324da6b7dd2623ce394e3827ff77ef684a3b98b 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/BreakDoorGoal.java -@@ -77,9 +77,10 @@ public class BreakDoorGoal extends DoorInteractGoal { +@@ -78,9 +78,10 @@ public class BreakDoorGoal extends DoorInteractGoal { return; } // CraftBukkit end @@ -185,7 +185,7 @@ index 784a894688f98f9d0368a36d456c5c94e1ee3695..a85885ee51df585fa11ae9f8fcd67ff2 } diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java -index d802985f1431be4332c07f0dab88feebedea4ce2..4e2c23ccdf4e4a4d65b291dbe20952bae1838bff 100644 +index 9e6f946e6d2878aa3fa8abe0f6fa4770d18676d3..32bb591371fe78ba10a2bc52389ef33978cbc0eb 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java +++ b/src/main/java/net/minecraft/world/entity/ai/goal/EatBlockGoal.java @@ -31,6 +31,11 @@ public class EatBlockGoal extends Goal { @@ -219,26 +219,26 @@ index ef71b3ef4444c05b4211de87e1c8ec52cbe3e72a..137ec75ee803789deb7b1ca93dd9369c public void start() { this.creeper.getNavigation().stop(); diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index 923806900ef6248576e71260d40e9caf2c8943e8..02e49c7ae5e120302b6479cf3e3934b9217eebf0 100644 +index dbcf14f5af9c9c0655a82529ee99450a8da14525..f745a554b9b84a53d9bd942ca9908153fb0a668c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -@@ -243,9 +243,10 @@ public class Goat extends Animal { +@@ -247,9 +247,10 @@ public class Goat extends Animal { player.setItemInHand(hand, itemstack1); - return InteractionResult.sidedSuccess(this.level().isClientSide); + return InteractionResult.SUCCESS; } else { + boolean isFood = this.isFood(itemstack); // Paper - track before stack is possibly decreased to 0 (Fixes MC-244739) InteractionResult enuminteractionresult = super.mobInteract(player, hand); - if (enuminteractionresult.consumesAction() && this.isFood(itemstack)) { + if (enuminteractionresult.consumesAction() && isFood) { // Paper - this.level().playSound((Player) null, (Entity) this, this.getEatingSound(itemstack), SoundSource.NEUTRAL, 1.0F, Mth.randomBetween(this.level().random, 0.8F, 1.2F)); + this.playEatingSound(); } diff --git a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -index 3c6edc5ea44b7ec15d8fc7a2dca95a11a0d6108a..ba4e0ad7c7c2731d61ec7f60f19d7e9ec31a28ba 100644 +index 30af4cbb17148c247a46c0346419d6c838dbc9d2..07c143c3eac263848fc5daf6f958d16a1a163e92 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java -@@ -260,6 +260,14 @@ public class ItemFrame extends HangingEntity { +@@ -272,6 +272,14 @@ public class ItemFrame extends HangingEntity { return (ItemStack) this.getEntityData().get(ItemFrame.DATA_ITEM); } @@ -251,10 +251,10 @@ index 3c6edc5ea44b7ec15d8fc7a2dca95a11a0d6108a..ba4e0ad7c7c2731d61ec7f60f19d7e9e + // Paper end + @Nullable - public MapId getFramedMapId(ItemStack itemstack) { - return (MapId) itemstack.get(DataComponents.MAP_ID); + public MapId getFramedMapId(ItemStack stack) { + return (MapId) stack.get(DataComponents.MAP_ID); diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java -index 08dcc94c9eca9a5fd61055f05b7737ba5840b5bf..e0e5046c84941a8d17e18c177f3daea9cb631940 100644 +index 15a1ea01917ce57c2457094186dde937c21ffb22..b0236c7bf9441aa84d3795ffed05dd6099f29636 100644 --- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java +++ b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java @@ -82,8 +82,8 @@ public class CatSpawner implements CustomSpawner { @@ -262,16 +262,16 @@ index 08dcc94c9eca9a5fd61055f05b7737ba5840b5bf..e0e5046c84941a8d17e18c177f3daea9 return 0; } else { + cat.moveTo(pos, 0.0F, 0.0F); // Paper - move up - Fix MC-147659 - cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, null); + cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), EntitySpawnReason.NATURAL, null); - cat.moveTo(pos, 0.0F, 0.0F); world.addFreshEntityWithPassengers(cat); return 1; } diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -index 396559c281eee9e8c677cb222721414e8d9e12a2..8b0ebf659f6b219ce2a5d10b0d79f9b89b47c911 100644 +index cad0b581c992edc5cd312a727695a443e26e96d8..9db647cfbd3f9c884465cf3d3a1b911d46a3da58 100644 --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java +++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -@@ -178,6 +178,11 @@ public class BeaconMenu extends AbstractContainerMenu { +@@ -164,6 +164,11 @@ public class BeaconMenu extends AbstractContainerMenu { // Paper end - Add PlayerChangeBeaconEffectEvent public void updateEffects(Optional> primary, Optional> secondary) { @@ -283,43 +283,27 @@ index 396559c281eee9e8c677cb222721414e8d9e12a2..8b0ebf659f6b219ce2a5d10b0d79f9b8 if (this.paymentSlot.hasItem()) { // Paper start - Add PlayerChangeBeaconEffectEvent io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent event = new io.papermc.paper.event.player.PlayerChangeBeaconEffectEvent((org.bukkit.entity.Player) this.player.player.getBukkitEntity(), convert(primary), convert(secondary), this.access.getLocation().getBlock()); -diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java -index cd90129be2cf8095abd80528e5de3bbe05022a9d..fad69dfc20574ab23634b14252b50929cca75b21 100644 ---- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java -@@ -51,4 +51,11 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock { - public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) { - TreeGrower.AZALEA.growTree(world, world.getChunkSource().getGenerator(), pos, state, random); - } -+ -+ // Paper start - Fix MC-224454 -+ @Override -+ public boolean isPathfindable(BlockState state, net.minecraft.world.level.pathfinder.PathComputationType type) { -+ return false; -+ } -+ // Paper end - } diff --git a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java -index fa5366961861370c2366e6f0ff026a6d65128316..a5c7c2d24498c66159316a4f92677625975ce5ca 100644 +index 7dd6b7c0ea472cfbc7ece55bc64bc5d85be4a6c0..6dcb571e9f35fbae724be69dc113b0c33eca63b3 100644 --- a/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java +++ b/src/main/java/net/minecraft/world/level/block/LayeredCauldronBlock.java -@@ -69,7 +69,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock { - if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent - if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) { - // CraftBukkit start -- if (entity.mayInteract(world, pos)) { -+ if ((entity instanceof net.minecraft.world.entity.player.Player || world.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) && entity.mayInteract(world, pos)) { // Paper - Fixes MC-248588 - if (!this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities - return; - } +@@ -72,7 +72,7 @@ public class LayeredCauldronBlock extends AbstractCauldronBlock { + if (entity.isOnFire() && this.isEntityInsideContent(state, pos, entity)) { + // CraftBukkit start - moved down + // entity.clearFire(); +- if (entity.mayInteract(worldserver, pos)) { ++ if ((entity instanceof net.minecraft.world.entity.player.Player || worldserver.getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) && entity.mayInteract(worldserver, pos)) { // Paper - Fixes MC-248588 + if (this.handleEntityOnFireInsideWithEvent(state, world, pos, entity)) { // Paper - fix powdered snow cauldron extinguishing entities + entity.clearFire(); + } diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index aa59a45bcbe652996eddb80a3187618b7f6d1234..f1a7054a0ee1842e78338d8984f151b24c352849 100644 +index a23a87da259ab8d28dd8d8513098cd0730e72e0c..18f8b2c469feef659437684ce156a79ec3a3ce83 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -648,13 +648,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -531,13 +531,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @Override - public void fillStackedContents(StackedContents finder) { + public void fillStackedContents(StackedItemContents finder) { - Iterator iterator = this.items.iterator(); - - while (iterator.hasNext()) { @@ -335,7 +319,7 @@ index aa59a45bcbe652996eddb80a3187618b7f6d1234..f1a7054a0ee1842e78338d8984f151b2 } } diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index e124f040386e130aebd7135434c4f06d130d28f6..f8d432ef21e59796da4b11c9748ba151c54e5e04 100644 +index 8aab6f68f576fb022eb59798585e264f5aafbc69..edd6017937a7f20a1b43fa15204ec130b524b52b 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java @@ -295,7 +295,11 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @@ -351,35 +335,42 @@ index e124f040386e130aebd7135434c4f06d130d28f6..f8d432ef21e59796da4b11c9748ba151 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java -index 055f4b87c01ee7ecf7d2a111b72cc5aa85d9fbe8..6684ded7135f943f8cea954b417f596369215357 100644 +index e64a30577e9000e5c4d22fd3d9cf8a9381c5c459..b9690f31d410e82d833b2ca805df2fa68abcb6d1 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java +++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java -@@ -100,13 +100,13 @@ public class TrialSpawnerData { +@@ -101,17 +101,19 @@ public class TrialSpawnerData { this.ejectingLootTable = rewardLootTable; } - public void reset() { + public void reset(TrialSpawner logic) { // Paper - Fix TrialSpawner forgets assigned mob; MC-273635 + this.currentMobs.clear(); + this.nextSpawnData = Optional.empty(); +- this.resetStatistics(); ++ this.resetStatistics(logic); + } + +- public void resetStatistics() { ++ public void resetStatistics(TrialSpawner logic) { // Paper - Fix TrialSpawner forgets assigned mob; MC-273635 this.detectedPlayers.clear(); this.totalMobsSpawned = 0; this.nextMobSpawnsAt = 0L; this.cooldownEndsAt = 0L; - this.currentMobs.clear(); -- this.nextSpawnData = Optional.empty(); ++ this.nextSpawnData = Optional.empty(); + if (!logic.getConfig().spawnPotentialsDefinition().isEmpty()) this.nextSpawnData = Optional.empty(); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635 } public boolean hasMobToSpawn(TrialSpawner logic, RandomSource random) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java -index ffabcfaef8defe932473dee515f05220921904e0..005aea8a747e9cbbc352b8b57c64b84ec71ad321 100644 +index 83cdeee5e2ce115ff696a5afc5465dc4301779b9..027d5c4117feba1e152d0ecf9923aef77ba72207 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java +++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java @@ -68,7 +68,7 @@ public enum TrialSpawnerState implements StringRepresentable { case INACTIVE -> trialSpawnerData.getOrCreateDisplayEntity(logic, world, WAITING_FOR_PLAYERS) == null ? this : WAITING_FOR_PLAYERS; case WAITING_FOR_PLAYERS -> { if (!logic.canSpawnInLevel(world)) { -- trialSpawnerData.reset(); -+ trialSpawnerData.reset(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635 +- trialSpawnerData.resetStatistics(); ++ trialSpawnerData.resetStatistics(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635 yield this; } else if (!trialSpawnerData.hasMobToSpawn(logic, world.random)) { yield INACTIVE; @@ -387,8 +378,8 @@ index ffabcfaef8defe932473dee515f05220921904e0..005aea8a747e9cbbc352b8b57c64b84e } case ACTIVE -> { if (!logic.canSpawnInLevel(world)) { -- trialSpawnerData.reset(); -+ trialSpawnerData.reset(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635 +- trialSpawnerData.resetStatistics(); ++ trialSpawnerData.resetStatistics(logic); // Paper - Fix TrialSpawner forgets assigned mob; MC-273635 yield WAITING_FOR_PLAYERS; } else if (!trialSpawnerData.hasMobToSpawn(logic, world.random)) { yield INACTIVE; @@ -401,25 +392,3 @@ index ffabcfaef8defe932473dee515f05220921904e0..005aea8a747e9cbbc352b8b57c64b84e yield WAITING_FOR_PLAYERS; } else { yield this; -diff --git a/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java b/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java -index 1595a379875abc718659f6b1ce7c64c6383b1bc8..788f79dc38012595b385ee6a449daa0bccf0079a 100644 ---- a/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java -+++ b/src/main/java/net/minecraft/world/level/portal/DimensionTransition.java -@@ -39,7 +39,7 @@ public record DimensionTransition(ServerLevel newLevel, Vec3 pos, Vec3 speed, fl - } - - public DimensionTransition(ServerLevel worldserver, Entity entity, DimensionTransition.PostDimensionTransition dimensiontransition_a, PlayerTeleportEvent.TeleportCause cause) { -- this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, 0.0F, 0.0F, false, dimensiontransition_a, cause); -+ this(worldserver, findAdjustedSharedSpawnPos(worldserver, entity), Vec3.ZERO, worldserver.getSharedSpawnAngle(), 0.0F, false, dimensiontransition_a, cause); // Paper - MC-200092 - fix spawn pos yaw being ignored - // CraftBukkit end - } - -@@ -55,7 +55,7 @@ public record DimensionTransition(ServerLevel newLevel, Vec3 pos, Vec3 speed, fl - } - - public static DimensionTransition missingRespawnBlock(ServerLevel world, Entity entity, DimensionTransition.PostDimensionTransition postDimensionTransition) { -- return new DimensionTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, 0.0F, 0.0F, true, postDimensionTransition); -+ return new DimensionTransition(world, findAdjustedSharedSpawnPos(world, entity), Vec3.ZERO, world.getSharedSpawnAngle(), 0.0F, true, postDimensionTransition); // Paper - MC-200092 - fix spawn pos yaw being ignored - } - - private static Vec3 findAdjustedSharedSpawnPos(ServerLevel world, Entity entity) { diff --git a/patches/unapplied/server/0746-Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/0742-Remove-unnecessary-onTrackingStart-during-navigation.patch similarity index 84% rename from patches/unapplied/server/0746-Remove-unnecessary-onTrackingStart-during-navigation.patch rename to patches/server/0742-Remove-unnecessary-onTrackingStart-during-navigation.patch index 104738383c..9cef4dcb92 100644 --- a/patches/unapplied/server/0746-Remove-unnecessary-onTrackingStart-during-navigation.patch +++ b/patches/server/0742-Remove-unnecessary-onTrackingStart-during-navigation.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove unnecessary onTrackingStart during navigation warning diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index d3707c3fabc09068f3b07edebe9a333c153dfab5..4bf6281a75597072b19658208e4447c4d1ee8ba2 100644 +index 79fabd52eb3a08ec9c9ab2ec5d6ff4a31a02a292..4b2309d27867eddc50093e895503e02184e1b825 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2186,7 +2186,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2267,7 +2267,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } if (entity instanceof Mob entityinsentient) { @@ -17,7 +17,7 @@ index d3707c3fabc09068f3b07edebe9a333c153dfab5..4bf6281a75597072b19658208e4447c4 String s = "onTrackingStart called during navigation iteration"; Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration")); -@@ -2266,7 +2266,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2347,7 +2347,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } if (entity instanceof Mob entityinsentient) { diff --git a/patches/unapplied/server/0747-Fix-custom-piglin-loved-items.patch b/patches/server/0743-Fix-custom-piglin-loved-items.patch similarity index 90% rename from patches/unapplied/server/0747-Fix-custom-piglin-loved-items.patch rename to patches/server/0743-Fix-custom-piglin-loved-items.patch index a09a51f7ea..358bd47f1e 100644 --- a/patches/unapplied/server/0747-Fix-custom-piglin-loved-items.patch +++ b/patches/server/0743-Fix-custom-piglin-loved-items.patch @@ -7,10 +7,10 @@ Upstream didn't modify the isLovedItem check in wantsToPickup so piglins never actually tried to pickup interestItems diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -index d601bff8e8f62af78791ad357b51b92faf04e55f..d3d50ec0f4466464c048449d8a844569c447d59b 100644 +index 4f3048615a34fc2c067e09aec76af94cde6a74e0..5c26beef2d3f3d4afa51950ddeb7089989218462 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -@@ -403,7 +403,7 @@ public class PiglinAi { +@@ -405,7 +405,7 @@ public class PiglinAi { } else { boolean flag = piglin.canAddToInventory(stack); diff --git a/patches/server/0744-EntityPickupItemEvent-fixes.patch b/patches/server/0744-EntityPickupItemEvent-fixes.patch new file mode 100644 index 0000000000..6e30e2ebcb --- /dev/null +++ b/patches/server/0744-EntityPickupItemEvent-fixes.patch @@ -0,0 +1,73 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Mon, 4 Jul 2022 21:45:36 -0700 +Subject: [PATCH] EntityPickupItemEvent fixes + +Fixes double firing of the event in PiglinAi + +Fixes cancelling the event for piglins still triggering the +advancement trigger + +Fires the event when a Raider tries to pick up a raid banner +to become raid leader. + +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +index 15a49e3541c8b45db5e472a64fa0cb94c5a72f67..e04d2c5e75dc774fe893a552474fdb8045c32693 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +@@ -429,7 +429,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento + + @Override + protected void pickUpItem(ServerLevel world, ItemEntity itemEntity) { +- this.onItemPickup(itemEntity); ++ // this.onItemPickup(itemEntity); // Paper - EntityPickupItemEvent fixes; call in PiglinAi#pickUpItem after EntityPickupItemEvent is fired + PiglinAi.pickUpItem(world, this, itemEntity); + } + +diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +index 5c26beef2d3f3d4afa51950ddeb7089989218462..e283b1296c1e831376bfe9491cbf02ed4b3fffe4 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java ++++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java +@@ -244,11 +244,16 @@ public class PiglinAi { + ItemStack itemstack; + + // CraftBukkit start +- if (itemEntity.getItem().is(Items.GOLD_NUGGET) && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, itemEntity, 0, false).isCancelled()) { ++ // Paper start - EntityPickupItemEvent fixes; fix event firing twice ++ if (itemEntity.getItem().is(Items.GOLD_NUGGET)/* && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, itemEntity, 0, false).isCancelled()*/) { // Paper ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, itemEntity, 0, false).isCancelled()) return; ++ piglin.onItemPickup(itemEntity); // Paper - moved from Piglin#pickUpItem - call prior to item entity modification ++ // Paper end + piglin.take(itemEntity, itemEntity.getItem().getCount()); + itemstack = itemEntity.getItem(); + itemEntity.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause + } else if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, itemEntity, itemEntity.getItem().getCount() - 1, false).isCancelled()) { ++ piglin.onItemPickup(itemEntity); // Paper - EntityPickupItemEvent fixes; moved from Piglin#pickUpItem - call prior to item entity modification + piglin.take(itemEntity, 1); + itemstack = PiglinAi.removeOneItemFromItemEntity(itemEntity); + } else { +@@ -263,7 +268,7 @@ public class PiglinAi { + } else if (PiglinAi.isFood(itemstack) && !PiglinAi.hasEatenRecently(piglin)) { + PiglinAi.eat(piglin); + } else { +- boolean flag = !piglin.equipItemIfPossible(world, itemstack, itemEntity).equals(ItemStack.EMPTY); // CraftBukkit ++ boolean flag = !piglin.equipItemIfPossible(world, itemstack, null).equals(ItemStack.EMPTY); // CraftBukkit // Paper - pass null item entity to prevent duplicate pickup item event call - called above. + + if (!flag) { + PiglinAi.putInInventory(piglin, itemstack); +diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java +index 69a0a8aa7eec0a68a1460f6d6a4b604963b884c4..02f2107285d1bbe2137afd4f94880ad1f9d82fb9 100644 +--- a/src/main/java/net/minecraft/world/entity/raid/Raider.java ++++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java +@@ -228,6 +228,11 @@ public abstract class Raider extends PatrollingMonster { + boolean flag = this.hasActiveRaid() && this.getCurrentRaid().getLeader(this.getWave()) != null; + + if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getOminousBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) { ++ // Paper start - EntityPickupItemEvent fixes ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) { ++ return; ++ } ++ // Paper end - EntityPickupItemEvent fixes + EquipmentSlot enumitemslot = EquipmentSlot.HEAD; + ItemStack itemstack1 = this.getItemBySlot(enumitemslot); + double d0 = (double) this.getEquipmentDropChance(enumitemslot); diff --git a/patches/unapplied/server/0749-Correctly-handle-interactions-with-items-on-cooldown.patch b/patches/server/0745-Correctly-handle-interactions-with-items-on-cooldown.patch similarity index 87% rename from patches/unapplied/server/0749-Correctly-handle-interactions-with-items-on-cooldown.patch rename to patches/server/0745-Correctly-handle-interactions-with-items-on-cooldown.patch index b7fa362a4b..fe489a8bd8 100644 --- a/patches/unapplied/server/0749-Correctly-handle-interactions-with-items-on-cooldown.patch +++ b/patches/server/0745-Correctly-handle-interactions-with-items-on-cooldown.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Correctly handle interactions with items on cooldown diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 03d89f326d320c5d778c3d1e2db7d6b88753faec..717d015dd4637dd9d568b751be1dc1046b0a0560 100644 +index a706f0855fdf88cc9aece3ba00ef574b9cd8bd11..2aee9c2fbe38076317a3de7c3fdbd6988b64b389 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -514,6 +514,7 @@ public class ServerPlayerGameMode { +@@ -520,6 +520,7 @@ public class ServerPlayerGameMode { BlockPos blockposition = hitResult.getBlockPos(); BlockState iblockdata = world.getBlockState(blockposition); boolean cancelledBlock = false; @@ -16,10 +16,10 @@ index 03d89f326d320c5d778c3d1e2db7d6b88753faec..717d015dd4637dd9d568b751be1dc104 if (!iblockdata.getBlock().isEnabled(world.enabledFeatures())) { return InteractionResult.FAIL; -@@ -523,10 +524,10 @@ public class ServerPlayerGameMode { +@@ -529,10 +530,10 @@ public class ServerPlayerGameMode { } - if (player.getCooldowns().isOnCooldown(stack.getItem())) { + if (player.getCooldowns().isOnCooldown(stack)) { - cancelledBlock = true; + cancelledItem = true; // Paper - correctly handle items on cooldown } @@ -30,10 +30,10 @@ index 03d89f326d320c5d778c3d1e2db7d6b88753faec..717d015dd4637dd9d568b751be1dc104 this.interactResult = event.useItemInHand() == Event.Result.DENY; this.interactPosition = blockposition.immutable(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index ba1599b733946bef468a9b006411f8827844e791..b6cca72b4785d5cf009077c81c1cca718d8cfe28 100644 +index f7e26e381c2a2fec70cc2df01a12e7dbeeab48cd..cb05a94f2856a8bfb478bceb7c8712bc5e7ad5c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -556,6 +556,12 @@ public class CraftEventFactory { +@@ -555,6 +555,12 @@ public class CraftEventFactory { } public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 targetPos) { @@ -46,7 +46,7 @@ index ba1599b733946bef468a9b006411f8827844e791..b6cca72b4785d5cf009077c81c1cca71 Player player = (who == null) ? null : (Player) who.getBukkitEntity(); CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); -@@ -590,6 +596,11 @@ public class CraftEventFactory { +@@ -589,6 +595,11 @@ public class CraftEventFactory { if (cancelledBlock) { event.setUseInteractedBlock(Event.Result.DENY); } diff --git a/patches/unapplied/server/0750-Add-PlayerInventorySlotChangeEvent.patch b/patches/server/0746-Add-PlayerInventorySlotChangeEvent.patch similarity index 91% rename from patches/unapplied/server/0750-Add-PlayerInventorySlotChangeEvent.patch rename to patches/server/0746-Add-PlayerInventorySlotChangeEvent.patch index 0f6a75faa3..74685096a5 100644 --- a/patches/unapplied/server/0750-Add-PlayerInventorySlotChangeEvent.patch +++ b/patches/server/0746-Add-PlayerInventorySlotChangeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerInventorySlotChangeEvent diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index ad3896dd524acb573adffdfb38b13dd699539cef..3dbaa3c6b75a0f8bfdef42d210f2ac6f560cde3d 100644 +index f87f12666d4708b7fb7ede3eff03570fed8d1f40..bb0aaa16f0de18b15764ba39a781e8b86d690bb9 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -352,6 +352,25 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { +@@ -381,6 +381,25 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { } } @@ -35,10 +35,10 @@ index ad3896dd524acb573adffdfb38b13dd699539cef..3dbaa3c6b75a0f8bfdef42d210f2ac6f @Override public void dataChanged(AbstractContainerMenu handler, int property, int value) {} diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index b8d8aad81f54f7f43c01da075e63ec9173750bec..f7b9849819c185cd89533aca1f6d34398ffc1077 100644 +index 3b92fb173f623a05ae99c86d98f2ecdf907f58c4..d830504d08c9de92797c432a868c1ee9dfc46a91 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -@@ -302,7 +302,7 @@ public abstract class AbstractContainerMenu { +@@ -330,7 +330,7 @@ public abstract class AbstractContainerMenu { while (iterator.hasNext()) { ContainerListener icrafting = (ContainerListener) iterator.next(); diff --git a/patches/unapplied/server/0751-Elder-Guardian-appearance-API.patch b/patches/server/0747-Elder-Guardian-appearance-API.patch similarity index 84% rename from patches/unapplied/server/0751-Elder-Guardian-appearance-API.patch rename to patches/server/0747-Elder-Guardian-appearance-API.patch index fd1cef6a09..c354816072 100644 --- a/patches/unapplied/server/0751-Elder-Guardian-appearance-API.patch +++ b/patches/server/0747-Elder-Guardian-appearance-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Elder Guardian appearance API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3374dcd3b1f22b6c1803b9580c4cea6552b6afb1..1e563ed8f7e85d68682e679b27b0f6100eb10aea 100644 +index 025c392f2ca89a87f6301d4af64c4d7daec58409..1dc5f21c337bc3fb67e5919308228d75b03989d1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3298,6 +3298,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3311,6 +3311,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper end diff --git a/patches/unapplied/server/0752-Add-entity-knockback-API.patch b/patches/server/0748-Add-entity-knockback-API.patch similarity index 86% rename from patches/unapplied/server/0752-Add-entity-knockback-API.patch rename to patches/server/0748-Add-entity-knockback-API.patch index b50878265d..71f4427274 100644 --- a/patches/unapplied/server/0752-Add-entity-knockback-API.patch +++ b/patches/server/0748-Add-entity-knockback-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add entity knockback API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 877e3d20edba3fe2ea6b51d0b54ec8893bd112ed..2a7fffa71106327d0ffee632408d45faaec76702 100644 +index 14b4c3835388d957653ba34444968bb718ce7f68..4fa19ddb1414282020e118eea298d57d2bf42754 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -1127,4 +1127,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -1146,4 +1146,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { throw new UnsupportedOperationException("Cannot set the hurt direction on a non player"); } // Paper end - hurt direction API diff --git a/patches/unapplied/server/0753-Detect-headless-JREs.patch b/patches/server/0749-Detect-headless-JREs.patch similarity index 96% rename from patches/unapplied/server/0753-Detect-headless-JREs.patch rename to patches/server/0749-Detect-headless-JREs.patch index 5ba28913a8..e680b6146f 100644 --- a/patches/unapplied/server/0753-Detect-headless-JREs.patch +++ b/patches/server/0749-Detect-headless-JREs.patch @@ -27,7 +27,7 @@ index 68098dfe716e93aafcca4d8d5b5a81d8648b3654..2b7070e0cefa7cf0777df159693750fe + } } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 467b8ca8007c5d3a7b72b88e3a979bdf09f1a283..13e1a914d4523f1c192db2a9a1ee6522e0ee27da 100644 +index cf071610ed662c4a309cc26ee73a74fa490d846f..47cd7c66ac37efebf2f63c49d78dd8fe44a70ef8 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -167,6 +167,18 @@ public class Main { diff --git a/patches/unapplied/server/0754-fix-entity-vehicle-collision-event-not-called.patch b/patches/server/0750-fix-entity-vehicle-collision-event-not-called.patch similarity index 79% rename from patches/unapplied/server/0754-fix-entity-vehicle-collision-event-not-called.patch rename to patches/server/0750-fix-entity-vehicle-collision-event-not-called.patch index e2f922a2a1..9b38b32086 100644 --- a/patches/unapplied/server/0754-fix-entity-vehicle-collision-event-not-called.patch +++ b/patches/server/0750-fix-entity-vehicle-collision-event-not-called.patch @@ -5,16 +5,16 @@ Subject: [PATCH] fix entity vehicle collision event not called diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -index 93634fb01962ca7a35026e3c365f2a7f6b258a39..a38ce400550893f63640e3bb5bb801ab40f06266 100644 +index ee7350e19a86ffa115e4bce6b186a2422951e89b..d8fcd6d1edec1f31a861fab4b86cbeb15ddc799d 100644 --- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java +++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java -@@ -165,7 +165,15 @@ public abstract class AbstractMinecart extends VehicleEntity { +@@ -157,7 +157,15 @@ public abstract class AbstractMinecart extends VehicleEntity { @Override public boolean canCollideWith(Entity other) { -- return Boat.canVehicleCollide(this, other); +- return AbstractBoat.canVehicleCollide(this, other); + // Paper start - fix VehicleEntityCollisionEvent not called when colliding with player -+ boolean collides = Boat.canVehicleCollide(this, other); ++ boolean collides = AbstractBoat.canVehicleCollide(this, other); + if (!collides) { + return false; + } diff --git a/patches/unapplied/server/0755-Add-EntityToggleSitEvent.patch b/patches/server/0751-Add-EntityToggleSitEvent.patch similarity index 79% rename from patches/unapplied/server/0755-Add-EntityToggleSitEvent.patch rename to patches/server/0751-Add-EntityToggleSitEvent.patch index 0ed0b95562..8b679dd170 100644 --- a/patches/unapplied/server/0755-Add-EntityToggleSitEvent.patch +++ b/patches/server/0751-Add-EntityToggleSitEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add EntityToggleSitEvent diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java -index 4c5b0b1a71ec5ba0e8dcd5ef52bf667e9bb30be9..87c669517baa923ffa7392e400e7344e81fc9406 100644 +index 550c7f3435cc6c3180769e47f05bf693bdc380e3..e9e4d6fd69f9eec25a75b2610e15a19f8326f87b 100644 --- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java +++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java -@@ -86,7 +86,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { +@@ -87,7 +87,7 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { } this.orderedToSit = nbt.getBoolean("Sitting"); @@ -17,7 +17,7 @@ index 4c5b0b1a71ec5ba0e8dcd5ef52bf667e9bb30be9..87c669517baa923ffa7392e400e7344e } @Override -@@ -166,6 +166,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { +@@ -167,6 +167,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity { } public void setInSittingPose(boolean inSittingPose) { @@ -31,19 +31,19 @@ index 4c5b0b1a71ec5ba0e8dcd5ef52bf667e9bb30be9..87c669517baa923ffa7392e400e7344e if (inSittingPose) { diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java -index 3265b3b5aede517b6fd8bb836947795bf8881350..9a0adf65d4d54852301a91b6fe444e4c5a139f5d 100644 +index ca45a8ccf7f4593d557d157470603e4d233d948d..d98e4882dcba8a903bc86c8d30b290e6e967cc75 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java -@@ -432,7 +432,7 @@ public class Fox extends Animal implements VariantHolder { +@@ -419,7 +419,7 @@ public class Fox extends Animal implements VariantHolder { this.setSleeping(nbt.getBoolean("Sleeping")); - this.setVariant(Fox.Type.byName(nbt.getString("Type"))); + this.setVariant(Fox.Variant.byName(nbt.getString("Type"))); - this.setSitting(nbt.getBoolean("Sitting")); + this.setSitting(nbt.getBoolean("Sitting"), false); // Paper - Add EntityToggleSitEvent this.setIsCrouching(nbt.getBoolean("Crouching")); if (this.level() instanceof ServerLevel) { this.setTargetGoals(); -@@ -445,6 +445,12 @@ public class Fox extends Animal implements VariantHolder { +@@ -432,6 +432,12 @@ public class Fox extends Animal implements VariantHolder { } public void setSitting(boolean sitting) { @@ -57,10 +57,10 @@ index 3265b3b5aede517b6fd8bb836947795bf8881350..9a0adf65d4d54852301a91b6fe444e4c } diff --git a/src/main/java/net/minecraft/world/entity/animal/Panda.java b/src/main/java/net/minecraft/world/entity/animal/Panda.java -index 7b3d5322611990406028e59b1409907291e27b21..293d6891948e99ac9bd741008f7dcbc5fc1a2e3d 100644 +index 4f04170b3ec4ff59358e10ccfd0799af3ab590c3..b654bec0fbe903fac24f3bb99399455bf367c68a 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Panda.java +++ b/src/main/java/net/minecraft/world/entity/animal/Panda.java -@@ -145,6 +145,7 @@ public class Panda extends Animal { +@@ -134,6 +134,7 @@ public class Panda extends Animal { } public void sit(boolean sitting) { @@ -69,10 +69,10 @@ index 7b3d5322611990406028e59b1409907291e27b21..293d6891948e99ac9bd741008f7dcbc5 } diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -index aecd17953dc117d369885d4c8d7b5c7c3a0f8f0f..0388b09e1c4f03958384680ed487792a54007463 100644 +index b6baa40dac6d6bf40c4ee7ee75b8a8e6f60733a1..c99d37a40c63726c11980adccc67d09fd5132885 100644 --- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java +++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java -@@ -570,7 +570,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -572,7 +572,7 @@ public class Camel extends AbstractHorse { } public void sitDown() { @@ -81,7 +81,7 @@ index aecd17953dc117d369885d4c8d7b5c7c3a0f8f0f..0388b09e1c4f03958384680ed487792a this.makeSound(SoundEvents.CAMEL_SIT); this.setPose(Pose.SITTING); this.gameEvent(GameEvent.ENTITY_ACTION); -@@ -579,7 +579,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -581,7 +581,7 @@ public class Camel extends AbstractHorse { } public void standUp() { @@ -90,7 +90,7 @@ index aecd17953dc117d369885d4c8d7b5c7c3a0f8f0f..0388b09e1c4f03958384680ed487792a this.makeSound(SoundEvents.CAMEL_STAND); this.setPose(Pose.STANDING); this.gameEvent(GameEvent.ENTITY_ACTION); -@@ -588,6 +588,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl +@@ -590,6 +590,7 @@ public class Camel extends AbstractHorse { } public void standUpInstantly() { diff --git a/patches/unapplied/server/0756-Add-fire-tick-delay-option.patch b/patches/server/0752-Add-fire-tick-delay-option.patch similarity index 95% rename from patches/unapplied/server/0756-Add-fire-tick-delay-option.patch rename to patches/server/0752-Add-fire-tick-delay-option.patch index 2ad454d1c6..7db107dee9 100644 --- a/patches/unapplied/server/0756-Add-fire-tick-delay-option.patch +++ b/patches/server/0752-Add-fire-tick-delay-option.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add fire-tick-delay option diff --git a/src/main/java/net/minecraft/world/level/block/FireBlock.java b/src/main/java/net/minecraft/world/level/block/FireBlock.java -index 9db6df5f28be559a324ead2fcfbe189eac076e2e..0a77a470d78f68e8397f29f298e7f52fbd7ba9a2 100644 +index 065d6164b5c9d65d20e7790c607d77e9ad70dfef..0e5a47ab235d99e6cb1468905f791c2c59ac0082 100644 --- a/src/main/java/net/minecraft/world/level/block/FireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FireBlock.java @@ -171,7 +171,7 @@ public class FireBlock extends BaseFireBlock { diff --git a/patches/unapplied/server/0757-Add-Moving-Piston-API.patch b/patches/server/0753-Add-Moving-Piston-API.patch similarity index 100% rename from patches/unapplied/server/0757-Add-Moving-Piston-API.patch rename to patches/server/0753-Add-Moving-Piston-API.patch diff --git a/patches/unapplied/server/0758-Ignore-impossible-spawn-tick.patch b/patches/server/0754-Ignore-impossible-spawn-tick.patch similarity index 90% rename from patches/unapplied/server/0758-Ignore-impossible-spawn-tick.patch rename to patches/server/0754-Ignore-impossible-spawn-tick.patch index f046102ceb..ee2750f36d 100644 --- a/patches/unapplied/server/0758-Ignore-impossible-spawn-tick.patch +++ b/patches/server/0754-Ignore-impossible-spawn-tick.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ignore impossible spawn tick diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 8efc06d29c62fa2be8515ed3359d52a6d4b807d2..f57e1b78204dff661ad5d3ee93a88a00330af2dc 100644 +index 1b6ec72f59504d2f420d6d5dcbed4d3b9115e3d8..7de66aa435dd36899b80f4ecc64480680e474d94 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -84,6 +84,7 @@ public abstract class BaseSpawner { diff --git a/patches/unapplied/server/0759-Fix-EntityArgument-and-EntitySelectorParser-permissi.patch b/patches/server/0755-Fix-EntityArgument-and-EntitySelectorParser-permissi.patch similarity index 100% rename from patches/unapplied/server/0759-Fix-EntityArgument-and-EntitySelectorParser-permissi.patch rename to patches/server/0755-Fix-EntityArgument-and-EntitySelectorParser-permissi.patch diff --git a/patches/unapplied/server/0760-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/0756-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch similarity index 84% rename from patches/unapplied/server/0760-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch rename to patches/server/0756-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch index cd0b3b2cc7..45c6c70db5 100644 --- a/patches/unapplied/server/0760-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch +++ b/patches/server/0756-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 180a86c419cad9873c53a49c8881ced647a753e0..1aa3396a33e24f3849725769fe58b57374ee7611 100644 +index 44f585b9dc9e3940193f07a2df1205907b4800ba..24834be9b5596745f9456488076bd89c3c7d2352 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3193,6 +3193,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3320,6 +3320,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess pluginManager.callEvent(entityCombustEvent); if (!entityCombustEvent.isCancelled()) { this.igniteForSeconds(entityCombustEvent.getDuration(), false); @@ -21,10 +21,10 @@ index 180a86c419cad9873c53a49c8881ced647a753e0..1aa3396a33e24f3849725769fe58b573 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java -index 0c5409af685ef1f251db3d9f9e21295c82a1e02a..8b5918dc07f17ae5001c03dc743128fd9520b819 100644 +index c8ca41cd81a72f9bff40f5c1b3bfc1189bf51f98..0cf4133849ed8ff6d4038cc41ede9d3645b31da1 100644 --- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java -@@ -135,6 +135,10 @@ public abstract class BaseFireBlock extends Block { +@@ -145,6 +145,10 @@ public abstract class BaseFireBlock extends Block { if (!event.isCancelled()) { entity.igniteForSeconds(event.getDuration(), false); diff --git a/patches/unapplied/server/0761-Add-PrePlayerAttackEntityEvent.patch b/patches/server/0757-Add-PrePlayerAttackEntityEvent.patch similarity index 81% rename from patches/unapplied/server/0761-Add-PrePlayerAttackEntityEvent.patch rename to patches/server/0757-Add-PrePlayerAttackEntityEvent.patch index b0f3a07890..5a925374e5 100644 --- a/patches/unapplied/server/0761-Add-PrePlayerAttackEntityEvent.patch +++ b/patches/server/0757-Add-PrePlayerAttackEntityEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PrePlayerAttackEntityEvent diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index fab56040ecf496e74f583ec5d6c6c9861cfa4e13..ad334f149fe1b44d4ebe48489dcd2811ff1b5cd0 100644 +index b8edbd23d547d7189ec64c5d3a8cd1d51859ce23..30e0a5fe3f9bd85d2b702c2c877c5682ed35d461 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1257,8 +1257,17 @@ public abstract class Player extends LivingEntity { +@@ -1222,8 +1222,17 @@ public abstract class Player extends LivingEntity { } public void attack(Entity target) { @@ -27,4 +27,4 @@ index fab56040ecf496e74f583ec5d6c6c9861cfa4e13..ad334f149fe1b44d4ebe48489dcd2811 + // Paper end - PlayerAttackEntityEvent float f = this.isAutoSpinAttack() ? this.autoSpinAttackDmg : (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE); ItemStack itemstack = this.getWeaponItem(); - DamageSource damagesource = this.damageSources().playerAttack(this); + DamageSource damagesource = (DamageSource) Optional.ofNullable(itemstack.getItem().getDamageSource(this)).orElse(this.damageSources().playerAttack(this)); diff --git a/patches/unapplied/server/0762-ensure-reset-EnderDragon-boss-event-name.patch b/patches/server/0758-ensure-reset-EnderDragon-boss-event-name.patch similarity index 89% rename from patches/unapplied/server/0762-ensure-reset-EnderDragon-boss-event-name.patch rename to patches/server/0758-ensure-reset-EnderDragon-boss-event-name.patch index e2a769583d..24d93dac22 100644 --- a/patches/unapplied/server/0762-ensure-reset-EnderDragon-boss-event-name.patch +++ b/patches/server/0758-ensure-reset-EnderDragon-boss-event-name.patch @@ -6,10 +6,10 @@ Subject: [PATCH] ensure reset EnderDragon boss event name Fix MC-257487 diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -index 98d1c097fdbbc8080624f365634e0812a5eea5ac..bf39f006efef529db697ed4dccbd1657a2673b79 100644 +index 8d0014b0db5ab42321150938fef98458fee84b17..3701cdc9f0e71d19a1090cf179bac9d5b8c4759a 100644 --- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java +++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java -@@ -73,6 +73,7 @@ public class EndDragonFight { +@@ -74,6 +74,7 @@ public class EndDragonFight { private static final int GATEWAY_DISTANCE = 96; public static final int DRAGON_SPAWN_Y = 128; private final Predicate validPlayer; @@ -17,7 +17,7 @@ index 98d1c097fdbbc8080624f365634e0812a5eea5ac..bf39f006efef529db697ed4dccbd1657 public final ServerBossEvent dragonEvent; public final ServerLevel level; private final BlockPos origin; -@@ -101,7 +102,7 @@ public class EndDragonFight { +@@ -102,7 +103,7 @@ public class EndDragonFight { } public EndDragonFight(ServerLevel world, long gatewaysSeed, EndDragonFight.Data data, BlockPos origin) { @@ -26,7 +26,7 @@ index 98d1c097fdbbc8080624f365634e0812a5eea5ac..bf39f006efef529db697ed4dccbd1657 this.gateways = new ObjectArrayList(); this.ticksSinceLastPlayerScan = 21; this.skipArenaLoadedCheck = false; -@@ -505,6 +506,10 @@ public class EndDragonFight { +@@ -506,6 +507,10 @@ public class EndDragonFight { this.ticksSinceDragonSeen = 0; if (dragon.hasCustomName()) { this.dragonEvent.setName(dragon.getDisplayName()); diff --git a/patches/unapplied/server/0763-Add-Player-Warden-Warning-API.patch b/patches/server/0759-Add-Player-Warden-Warning-API.patch similarity index 93% rename from patches/unapplied/server/0763-Add-Player-Warden-Warning-API.patch rename to patches/server/0759-Add-Player-Warden-Warning-API.patch index bbb7bff753..1ac290e09b 100644 --- a/patches/unapplied/server/0763-Add-Player-Warden-Warning-API.patch +++ b/patches/server/0759-Add-Player-Warden-Warning-API.patch @@ -10,10 +10,10 @@ public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTick public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1e563ed8f7e85d68682e679b27b0f6100eb10aea..922ec82d566fd5ac0b40ed95629e63be3d1bf264 100644 +index 1dc5f21c337bc3fb67e5919308228d75b03989d1..2c38725e6fc0a264df3a0d34c21ab774ad3e2fb5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -3303,6 +3303,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -3316,6 +3316,41 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void showElderGuardian(boolean silent) { if (getHandle().connection != null) getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.GUARDIAN_ELDER_EFFECT, silent ? 0F : 1F)); } diff --git a/patches/unapplied/server/0764-More-vanilla-friendly-methods-to-update-trades.patch b/patches/server/0760-More-vanilla-friendly-methods-to-update-trades.patch similarity index 90% rename from patches/unapplied/server/0764-More-vanilla-friendly-methods-to-update-trades.patch rename to patches/server/0760-More-vanilla-friendly-methods-to-update-trades.patch index 5c30d5f82c..b3901a0ae7 100644 --- a/patches/unapplied/server/0764-More-vanilla-friendly-methods-to-update-trades.patch +++ b/patches/server/0760-More-vanilla-friendly-methods-to-update-trades.patch @@ -5,10 +5,10 @@ Subject: [PATCH] More vanilla friendly methods to update trades diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 9d5a5a7fff7f75871e167f83edb0e9d5348748d7..393588661c41b490ee6bce2f687962f7ddeff7d4 100644 +index f51078e4b9e6267fa43795d009f5d149b86acb5a..a573aa4d387ad3a4e1017890f2b50b83a3c27ff4 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -921,6 +921,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -895,6 +895,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override protected void updateTrades() { @@ -21,7 +21,7 @@ index 9d5a5a7fff7f75871e167f83edb0e9d5348748d7..393588661c41b490ee6bce2f687962f7 VillagerData villagerdata = this.getVillagerData(); Int2ObjectMap int2objectmap; -@@ -938,9 +944,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -912,9 +918,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler if (avillagertrades_imerchantrecipeoption != null) { MerchantOffers merchantrecipelist = this.getOffers(); @@ -35,10 +35,10 @@ index 9d5a5a7fff7f75871e167f83edb0e9d5348748d7..393588661c41b490ee6bce2f687962f7 public void gossip(ServerLevel world, Villager villager, long time) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -index 52312bec840322d32ea845f0bd64eb3ca1380854..bd2987fa1fb194a581567134ed980e8fc043f435 100644 +index 45c44c46edee9f46b8e197f1f54ea2779bf1184c..8e895d6f84f7d84b219f2424909dd42e5f08dec4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java -@@ -97,6 +97,34 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { +@@ -98,6 +98,34 @@ public class CraftVillager extends CraftAbstractVillager implements Villager { } // Paper start diff --git a/patches/unapplied/server/0765-Add-paper-dumplisteners-command.patch b/patches/server/0761-Add-paper-dumplisteners-command.patch similarity index 100% rename from patches/unapplied/server/0765-Add-paper-dumplisteners-command.patch rename to patches/server/0761-Add-paper-dumplisteners-command.patch diff --git a/patches/unapplied/server/0737-Missing-effect-cause.patch b/patches/unapplied/server/0737-Missing-effect-cause.patch deleted file mode 100644 index e24048113b..0000000000 --- a/patches/unapplied/server/0737-Missing-effect-cause.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> -Date: Tue, 16 Aug 2022 19:44:55 +0200 -Subject: [PATCH] Missing effect cause - - -diff --git a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -index 3dec72f407ca4af53ac5fe32f05326638af05474..01a0731e92d39c8718538244e34a271fb8717fc2 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -+++ b/src/main/java/net/minecraft/world/entity/animal/axolotl/Axolotl.java -@@ -401,7 +401,7 @@ public class Axolotl extends Animal implements LerpingModel, VariantHolder -Date: Mon, 4 Jul 2022 21:45:36 -0700 -Subject: [PATCH] EntityPickupItemEvent fixes - -Fixes double firing of the event in PiglinAi - -Fixes cancelling the event for piglins still triggering the -advancement trigger - -Fires the event when a Raider tries to pick up a raid banner -to become raid leader. - -diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -index d2dfa49e124460f4762b950f9ded106d2ec15dc2..bc58323801ee16fe9b63c21332144ec002a902f2 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -@@ -412,7 +412,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento - - @Override - protected void pickUpItem(ItemEntity item) { -- this.onItemPickup(item); -+ // this.onItemPickup(item); // Paper - EntityPickupItemEvent fixes; call in PiglinAi#pickUpItem after EntityPickupItemEvent is fired - PiglinAi.pickUpItem(this, item); - } - -diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -index d3d50ec0f4466464c048449d8a844569c447d59b..b9810a1f6ac91ae9631dd1ebc225f009d91b7845 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java -@@ -242,11 +242,16 @@ public class PiglinAi { - ItemStack itemstack; - - // CraftBukkit start -- if (drop.getItem().is(Items.GOLD_NUGGET) && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, drop, 0, false).isCancelled()) { -+ // Paper start - EntityPickupItemEvent fixes; fix event firing twice -+ if (drop.getItem().is(Items.GOLD_NUGGET) /* && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, drop, 0, false).isCancelled() */) { -+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, drop, 0, false).isCancelled()) return; -+ piglin.onItemPickup(drop); // Paper - moved from Piglin#pickUpItem - call prior to item entity modification -+ // Paper end - EntityPickupItemEvent fixes - piglin.take(drop, drop.getItem().getCount()); - itemstack = drop.getItem(); - drop.discard(EntityRemoveEvent.Cause.PICKUP); // CraftBukkit - add Bukkit remove cause - } else if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(piglin, drop, drop.getItem().getCount() - 1, false).isCancelled()) { -+ piglin.onItemPickup(drop); // Paper - EntityPickupItemEvent fixes; moved from Piglin#pickUpItem - call prior to item entity modification - piglin.take(drop, 1); - itemstack = PiglinAi.removeOneItemFromItemEntity(drop); - } else { -@@ -261,7 +266,7 @@ public class PiglinAi { - } else if (PiglinAi.isFood(itemstack) && !PiglinAi.hasEatenRecently(piglin)) { - PiglinAi.eat(piglin); - } else { -- boolean flag = !piglin.equipItemIfPossible(itemstack, drop).equals(ItemStack.EMPTY); // CraftBukkit -+ boolean flag = !piglin.equipItemIfPossible(itemstack, null).equals(ItemStack.EMPTY); // CraftBukkit // Paper - pass null item entity to prevent duplicate pickup item event call - called above. - - if (!flag) { - PiglinAi.putInInventory(piglin, itemstack); -diff --git a/src/main/java/net/minecraft/world/entity/raid/Raider.java b/src/main/java/net/minecraft/world/entity/raid/Raider.java -index 174d246b0a4d0fc9d769aad08da627ca8487bdf2..bbf21ea433f9e3963aac0ede597ed8d3c8e50ed8 100644 ---- a/src/main/java/net/minecraft/world/entity/raid/Raider.java -+++ b/src/main/java/net/minecraft/world/entity/raid/Raider.java -@@ -225,6 +225,11 @@ public abstract class Raider extends PatrollingMonster { - boolean flag = this.hasActiveRaid() && this.getCurrentRaid().getLeader(this.getWave()) != null; - - if (this.hasActiveRaid() && !flag && ItemStack.matches(itemstack, Raid.getLeaderBannerInstance(this.registryAccess().lookupOrThrow(Registries.BANNER_PATTERN)))) { -+ // Paper start - EntityPickupItemEvent fixes -+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPickupItemEvent(this, item, 0, false).isCancelled()) { -+ return; -+ } -+ // Paper end - EntityPickupItemEvent fixes - EquipmentSlot enumitemslot = EquipmentSlot.HEAD; - ItemStack itemstack1 = this.getItemBySlot(enumitemslot); - double d0 = (double) this.getEquipmentDropChance(enumitemslot); diff --git a/todo.txt b/todo.txt deleted file mode 100644 index 8cb87a4cf7..0000000000 --- a/todo.txt +++ /dev/null @@ -1 +0,0 @@ -MCUTILS: look at chunkmap changes around line 555. I removed our changes because I wasn't sure what changed, needs to be looked at!