diff options
author | Noah van der Aa <[email protected]> | 2024-10-24 00:32:21 +0200 |
---|---|---|
committer | Noah van der Aa <[email protected]> | 2024-10-24 00:32:21 +0200 |
commit | 5a6011c08c80fb2c7e0c7242bf272f8cde078cb2 (patch) | |
tree | 0ccda262cce3c308e054ef7f89a84308c3973f5c /patches/unapplied | |
parent | dd87f9fe83f98116d2b79102edcd74ab72efd2f4 (diff) | |
download | Paper-5a6011c08c80fb2c7e0c7242bf272f8cde078cb2.tar.gz Paper-5a6011c08c80fb2c7e0c7242bf272f8cde078cb2.zip |
MOOOOOOOOOOOOOORE
Diffstat (limited to 'patches/unapplied')
24 files changed, 0 insertions, 1052 deletions
diff --git a/patches/unapplied/server/0792-Fix-force-opening-enchantment-tables.patch b/patches/unapplied/server/0792-Fix-force-opening-enchantment-tables.patch deleted file mode 100644 index 89326fc719..0000000000 --- a/patches/unapplied/server/0792-Fix-force-opening-enchantment-tables.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Thu, 26 Jan 2023 16:19:26 -0800 -Subject: [PATCH] Fix force-opening enchantment tables - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 049db909fbd8610ebb688d948f5d03c97ab23495..1ff114f792ca12bc5408cdd9ab0ad23c3158b99c 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -411,7 +411,18 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { - - // If there isn't an enchant table we can force create one, won't be very useful though. - BlockPos pos = CraftLocation.toBlockPosition(location); -- this.getHandle().openMenu(Blocks.ENCHANTING_TABLE.defaultBlockState().getMenuProvider(this.getHandle().level(), pos)); -+ // Paper start -+ MenuProvider menuProvider = Blocks.ENCHANTING_TABLE.defaultBlockState().getMenuProvider(this.getHandle().level(), pos); -+ if (menuProvider == null) { -+ if (!force) { -+ return null; -+ } -+ menuProvider = new net.minecraft.world.SimpleMenuProvider((syncId, inventory, player) -> { -+ return new net.minecraft.world.inventory.EnchantmentMenu(syncId, inventory, net.minecraft.world.inventory.ContainerLevelAccess.create(this.getHandle().level(), pos)); -+ }, Component.translatable("container.enchant")); -+ } -+ this.getHandle().openMenu(menuProvider); -+ // Paper end - - if (force) { - this.getHandle().containerMenu.checkReachable = false; diff --git a/patches/unapplied/server/0793-Add-Entity-Body-Yaw-API.patch b/patches/unapplied/server/0793-Add-Entity-Body-Yaw-API.patch deleted file mode 100644 index c1be71053d..0000000000 --- a/patches/unapplied/server/0793-Add-Entity-Body-Yaw-API.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: TheTuso <[email protected]> -Date: Thu, 2 Feb 2023 16:40:41 +0100 -Subject: [PATCH] Add Entity Body Yaw API - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index ac513d3162a0794f226abc80bff21c799fe5802c..7c7501b4b21530d0641774f64e87d7d1ca71a33c 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1183,6 +1183,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { - } - // Paper end - entity powdered snow API - -+ // Paper start - entity body yaw API -+ @Override -+ public double getX() { -+ return this.entity.getX(); -+ } -+ -+ @Override -+ public double getY() { -+ return this.entity.getY(); -+ } -+ -+ @Override -+ public double getZ() { -+ return this.entity.getZ(); -+ } -+ -+ @Override -+ public float getPitch() { -+ return this.entity.getXRot(); -+ } -+ -+ @Override -+ public float getYaw() { -+ return this.entity.getBukkitYaw(); -+ } -+ // Paper end - entity body yaw API -+ - // Paper start - missing entity api - @Override - public boolean isInvisible() { // Paper - moved up from LivingEntity -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 516ea1ec9ae5069c3c0e4708f62164a91960b627..a50803a9b41cf3c0b081eb6b786f952dd0ed284f 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -1192,4 +1192,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { - this.getHandle().frictionState = state; - } - // Paper end - friction API -+ -+ // Paper start - body yaw API -+ @Override -+ public float getBodyYaw() { -+ return this.getHandle().getVisualRotationYInDegrees(); -+ } -+ -+ @Override -+ public void setBodyYaw(final float bodyYaw) { -+ this.getHandle().setYBodyRot(bodyYaw); -+ } -+ // Paper end - body yaw API - } diff --git a/patches/unapplied/server/0794-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch b/patches/unapplied/server/0794-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch deleted file mode 100644 index 962917dab8..0000000000 --- a/patches/unapplied/server/0794-Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Warrior <[email protected]> -Date: Mon, 27 Feb 2023 19:16:07 +0100 -Subject: [PATCH] Fix MC-157464 Prevent sleeping villagers moving towards food - -Fixes sleeping villagers moving to nearby food by adding an !isSleeping predicate - -Relevant links: -https://bugs.mojang.com/browse/MC-157464 -https://github.com/PaperMC/Paper/issues/8569 - -diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java -index 5a18bf854792339fcd54e32f8053d014f3d195a5..f000a6c1e61198e6dd06ae5f084d12fdf309f50a 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java -+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/VillagerGoalPackages.java -@@ -38,7 +38,7 @@ public class VillagerGoalPackages { - Pair.of(1, new MoveToTargetSink()), - Pair.of(2, PoiCompetitorScan.create()), - Pair.of(3, new LookAndFollowTradingPlayerSink(speed)), -- Pair.of(5, GoToWantedItem.create(speed, false, 4)), -+ Pair.of(5, GoToWantedItem.create(villager -> !villager.isSleeping(), speed, false, 4)), // Paper - Fix MC-157464 - Pair.of( - 6, AcquirePoi.create(profession.acquirableJobSite(), MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, true, Optional.empty()) - ), diff --git a/patches/unapplied/server/0795-Add-EntityFertilizeEggEvent.patch b/patches/unapplied/server/0795-Add-EntityFertilizeEggEvent.patch deleted file mode 100644 index 07253994cb..0000000000 --- a/patches/unapplied/server/0795-Add-EntityFertilizeEggEvent.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Lulu13022002 <[email protected]> -Date: Fri, 24 Jun 2022 12:39:34 +0200 -Subject: [PATCH] Add EntityFertilizeEggEvent - - -diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index 34e6bf677a9f4548f3febe6d57e6af9602530271..2e5ef2a680e294b49f29e8d7ba8bd0ed023c393c 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java -+++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -441,6 +441,10 @@ public class Turtle extends Animal { - if (entityplayer == null && this.partner.getLoveCause() != null) { - entityplayer = this.partner.getLoveCause(); - } -+ // Paper start - Add EntityFertilizeEggEvent event -+ io.papermc.paper.event.entity.EntityFertilizeEggEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityFertilizeEggEvent(this.animal, this.partner); -+ if (event.isCancelled()) return; -+ // Paper end - Add EntityFertilizeEggEvent event - - if (entityplayer != null) { - entityplayer.awardStat(Stats.ANIMALS_BRED); -@@ -455,7 +459,7 @@ public class Turtle extends Animal { - RandomSource randomsource = this.animal.getRandom(); - - if (this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) { -- this.level.addFreshEntity(new ExperienceOrb(this.level, this.animal.getX(), this.animal.getY(), this.animal.getZ(), randomsource.nextInt(7) + 1, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer)); // Paper; -+ if (event.getExperience() > 0) this.level.addFreshEntity(new ExperienceOrb(this.level, this.animal.getX(), this.animal.getY(), this.animal.getZ(), event.getExperience(), org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer)); // Paper - Add EntityFertilizeEggEvent event - } - - } -diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -index a7af50ebc17abd829a7254c03785206da9624060..816977990639ec0559b652fc9666afd5046f0a5d 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java -@@ -261,7 +261,12 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> { - - @Override - public void spawnChildFromBreeding(ServerLevel world, Animal other) { -- this.finalizeSpawnChildFromBreeding(world, other, null); -+ // Paper start - Add EntityFertilizeEggEvent event -+ final io.papermc.paper.event.entity.EntityFertilizeEggEvent result = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityFertilizeEggEvent(this, other); -+ if (result.isCancelled()) return; -+ -+ this.finalizeSpawnChildFromBreeding(world, other, null, result.getExperience()); // Paper - use craftbukkit call that takes experience amount -+ // Paper end - Add EntityFertilizeEggEvent event - this.getBrain().setMemory(MemoryModuleType.IS_PREGNANT, Unit.INSTANCE); - } - -diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -index d34d8fe70379dcad9540739ec0ae1c94f01fc46b..fadd341ff398886a4da102eefa1beb95a63bbd6d 100644 ---- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java -@@ -345,11 +345,16 @@ public class Sniffer extends Animal { - - @Override - public void spawnChildFromBreeding(ServerLevel world, Animal other) { -+ // Paper start - Add EntityFertilizeEggEvent event -+ final io.papermc.paper.event.entity.EntityFertilizeEggEvent result = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityFertilizeEggEvent(this, other); -+ if (result.isCancelled()) return; -+ // Paper end - Add EntityFertilizeEggEvent event -+ - ItemStack itemstack = new ItemStack(Items.SNIFFER_EGG); - ItemEntity entityitem = new ItemEntity(world, this.position().x(), this.position().y(), this.position().z(), itemstack); - - entityitem.setDefaultPickUpDelay(); -- this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null); -+ this.finalizeSpawnChildFromBreeding(world, other, (AgeableMob) null, result.getExperience()); // Paper - Add EntityFertilizeEggEvent event - if (this.spawnAtLocation(entityitem) != null) { // Paper - Call EntityDropItemEvent - this.playSound(SoundEvents.SNIFFER_EGG_PLOP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 0.5F); - } // Paper - Call EntityDropItemEvent -diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index b6cca72b4785d5cf009077c81c1cca718d8cfe28..a0b387ddf3cc1e3473c6b35175ac8b68c717cfbe 100644 ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -2197,4 +2197,28 @@ public class CraftEventFactory { - return event.callEvent(); - } - // Paper end -+ -+ // Paper start - add EntityFertilizeEggEvent -+ /** -+ * Calls the {@link io.papermc.paper.event.entity.EntityFertilizeEggEvent}. -+ * If the event is cancelled, this method also resets the love on both the {@code breeding} and {@code other} entity. -+ * -+ * @param breeding the entity on which #spawnChildFromBreeding was called. -+ * @param other the partner of the entity. -+ * @return the event after it was called. The instance may be used to retrieve the experience of the event. -+ */ -+ public static io.papermc.paper.event.entity.EntityFertilizeEggEvent callEntityFertilizeEggEvent(Animal breeding, Animal other) { -+ ServerPlayer serverPlayer = breeding.getLoveCause(); -+ if (serverPlayer == null) serverPlayer = other.getLoveCause(); -+ final int experience = breeding.getRandom().nextInt(7) + 1; // From Animal#spawnChildFromBreeding(ServerLevel, Animal) -+ -+ final io.papermc.paper.event.entity.EntityFertilizeEggEvent event = new io.papermc.paper.event.entity.EntityFertilizeEggEvent((LivingEntity) breeding.getBukkitEntity(), (LivingEntity) other.getBukkitEntity(), serverPlayer == null ? null : serverPlayer.getBukkitEntity(), breeding.breedItem == null ? null : CraftItemStack.asCraftMirror(breeding.breedItem).clone(), experience); -+ if (!event.callEvent()) { -+ breeding.resetLove(); -+ other.resetLove(); // stop the pathfinding to avoid infinite loop -+ } -+ -+ return event; -+ } -+ // Paper end - add EntityFertilizeEggEvent - } diff --git a/patches/unapplied/server/0796-Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/unapplied/server/0796-Fix-HumanEntity-drop-not-updating-the-client-inv.patch deleted file mode 100644 index b804a77828..0000000000 --- a/patches/unapplied/server/0796-Fix-HumanEntity-drop-not-updating-the-client-inv.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sun, 10 Oct 2021 18:18:01 -0700 -Subject: [PATCH] Fix HumanEntity#drop not updating the client inv - -== AT == -public net.minecraft.server.level.ServerPlayer containerSynchronizer - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 1ff114f792ca12bc5408cdd9ab0ad23c3158b99c..b782cc64426a058881947ed62316c1cb8d332037 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -759,8 +759,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { - // Paper end - @Override - public boolean dropItem(boolean dropAll) { -- if (!(this.getHandle() instanceof ServerPlayer)) return false; -- return ((ServerPlayer) this.getHandle()).drop(dropAll); -+ // Paper start - Fix HumanEntity#drop not updating the client inv -+ if (!(this.getHandle() instanceof ServerPlayer player)) return false; -+ boolean success = player.drop(dropAll); -+ if (!success) return false; -+ final net.minecraft.world.entity.player.Inventory inv = player.getInventory(); -+ final java.util.OptionalInt optionalSlot = player.containerMenu.findSlot(inv, inv.selected); -+ optionalSlot.ifPresent(slot -> player.containerSynchronizer.sendSlotChange(player.containerMenu, slot, inv.getSelected())); -+ return true; -+ // Paper end - Fix HumanEntity#drop not updating the client inv - } - - @Override diff --git a/patches/unapplied/server/0797-Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/unapplied/server/0797-Add-CompostItemEvent-and-EntityCompostItemEvent.patch deleted file mode 100644 index 85321a4a5b..0000000000 --- a/patches/unapplied/server/0797-Add-CompostItemEvent-and-EntityCompostItemEvent.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Noah van der Aa <[email protected]> -Date: Sun, 8 Aug 2021 19:56:02 +0200 -Subject: [PATCH] Add CompostItemEvent and EntityCompostItemEvent - - -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 19fa8a9f935e9063497f8c0bd7909036fa0af2b7..d3d12f9114173f4971f95d7ef895a4374705bd3f 100644 ---- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java -@@ -336,7 +336,21 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { - int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL); - float f = ComposterBlock.COMPOSTABLES.getFloat(itemstack.getItem()); - -- if ((i != 0 || f <= 0.0F) && rand >= (double) f) { -+ // Paper start - Add CompostItemEvent and EntityCompostItemEvent -+ boolean willRaiseLevel = !((i != 0 || f <= 0.0F) && rand >= (double) f); -+ final io.papermc.paper.event.block.CompostItemEvent event; -+ if (entity == null) { -+ event = new io.papermc.paper.event.block.CompostItemEvent(org.bukkit.craftbukkit.block.CraftBlock.at(generatoraccess, blockposition), itemstack.getBukkitStack(), willRaiseLevel); -+ } else { -+ event = new io.papermc.paper.event.entity.EntityCompostItemEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(generatoraccess, blockposition), itemstack.getBukkitStack(), willRaiseLevel); -+ } -+ if (!event.callEvent()) { // check for cancellation of entity event (non entity event can't be cancelled cause of hoppers) -+ return null; -+ } -+ willRaiseLevel = event.willRaiseLevel(); -+ -+ if (!willRaiseLevel) { -+ // Paper end - Add CompostItemEvent and EntityCompostItemEvent - return iblockdata; - } else { - int j = i + 1; -@@ -485,6 +499,11 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { - if (!itemstack.isEmpty()) { - this.changed = true; - BlockState iblockdata = ComposterBlock.addItem((Entity) null, this.state, this.level, this.pos, itemstack); -+ // Paper start - Add CompostItemEvent and EntityCompostItemEvent -+ if (iblockdata == null) { -+ return; -+ } -+ // Paper end - Add CompostItemEvent and EntityCompostItemEvent - - this.level.levelEvent(1500, this.pos, iblockdata != this.state ? 1 : 0); - this.removeItemNoUpdate(0); diff --git a/patches/unapplied/server/0798-Correctly-handle-ArmorStand-invisibility.patch b/patches/unapplied/server/0798-Correctly-handle-ArmorStand-invisibility.patch deleted file mode 100644 index 34b66d686a..0000000000 --- a/patches/unapplied/server/0798-Correctly-handle-ArmorStand-invisibility.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sun, 5 Mar 2023 14:38:21 -0800 -Subject: [PATCH] Correctly handle ArmorStand invisibility - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 1087840331f68ffe79e79f6493137b2b894832f9..9fe85d6f807e64cf02d8e1921672e3196f6d606f 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -152,6 +152,14 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { - this.getHandle().noPhysics = !gravity; - } - -+ // Paper start - Armor Stand has its own invisible field -+ @Override -+ public void setInvisible(final boolean invisible) { -+ this.getHandle().setInvisible(invisible); -+ super.setInvisible(invisible); -+ } -+ // Paper end -+ - @Override - public boolean isVisible() { - return !this.getHandle().isInvisible(); diff --git a/patches/unapplied/server/0799-Fix-advancement-triggers-for-entity-damage.patch b/patches/unapplied/server/0799-Fix-advancement-triggers-for-entity-damage.patch deleted file mode 100644 index 94c53ab61c..0000000000 --- a/patches/unapplied/server/0799-Fix-advancement-triggers-for-entity-damage.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Thu, 16 Mar 2023 10:04:17 +0100 -Subject: [PATCH] Fix advancement triggers for entity damage - -Changes the Interaction entity's trigger to use the vanilla -generic damage source - -Fixes a couple places where the original damage and modified damage -were passed in the reverse order to the advancement triggers - -diff --git a/src/main/java/net/minecraft/world/entity/Interaction.java b/src/main/java/net/minecraft/world/entity/Interaction.java -index 2ebbf7954dc5e0d6c9d53327d05b725eec310086..c5bd2e90ad74ba08910f65a2e07b6f76435df10f 100644 ---- a/src/main/java/net/minecraft/world/entity/Interaction.java -+++ b/src/main/java/net/minecraft/world/entity/Interaction.java -@@ -156,7 +156,7 @@ public class Interaction extends Entity implements Attackable, Targeting { - // CraftBukkit end - this.attack = new Interaction.PlayerAction(entityhuman.getUUID(), this.level().getGameTime()); - if (entityhuman instanceof ServerPlayer entityplayer) { -- CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, source, (float) event.getFinalDamage(), 1.0F, false); // CraftBukkit -+ CriteriaTriggers.PLAYER_HURT_ENTITY.trigger(entityplayer, this, entityhuman.damageSources().generic(), 1.0F, (float) event.getFinalDamage(), false); // CraftBukkit // Paper - use correct source and fix taken/dealt param order - } - - return !this.getResponse(); -diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9e58a85a7de53b17fa149ae0b4951baa351d99db..4e96a65396b687d2823f2229744f5d448ba87512 100644 ---- a/src/main/java/net/minecraft/world/entity/LivingEntity.java -+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -2388,7 +2388,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - // Duplicate triggers if blocking - if (event.getDamage(DamageModifier.BLOCKING) < 0) { - if (this instanceof ServerPlayer) { -- CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer) this, damagesource, f, originalDamage, true); -+ CriteriaTriggers.ENTITY_HURT_PLAYER.trigger((ServerPlayer) this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order - f2 = (float) -event.getDamage(DamageModifier.BLOCKING); - if (f2 > 0.0F && f2 < 3.4028235E37F) { - ((ServerPlayer) this).awardStat(Stats.DAMAGE_BLOCKED_BY_SHIELD, Math.round(originalDamage * 10.0F)); -@@ -2396,7 +2396,7 @@ public abstract class LivingEntity extends Entity implements Attackable { - } - - if (damagesource.getEntity() instanceof ServerPlayer) { -- CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource, f, originalDamage, true); -+ CriteriaTriggers.PLAYER_HURT_ENTITY.trigger((ServerPlayer) damagesource.getEntity(), this, damagesource, originalDamage, f, true); // Paper - fix taken/dealt param order - } - - return true; diff --git a/patches/unapplied/server/0800-Fix-text-display-error-on-spawn.patch b/patches/unapplied/server/0800-Fix-text-display-error-on-spawn.patch deleted file mode 100644 index 7f64cfe6d9..0000000000 --- a/patches/unapplied/server/0800-Fix-text-display-error-on-spawn.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Nassim Jahnke <[email protected]> -Date: Thu, 16 Mar 2023 16:27:50 +0100 -Subject: [PATCH] Fix text display error on spawn - - -diff --git a/src/main/java/net/minecraft/world/entity/Display.java b/src/main/java/net/minecraft/world/entity/Display.java -index bd56721485b3b4ac81c97d60fc2a83bfc20977c0..a658943669cdfd49f66ba713505d11b33306ed86 100644 ---- a/src/main/java/net/minecraft/world/entity/Display.java -+++ b/src/main/java/net/minecraft/world/entity/Display.java -@@ -892,7 +892,7 @@ public abstract class Display extends Entity { - b = loadFlag(b, nbt, "default_background", (byte)4); - Optional<Display.TextDisplay.Align> optional = Display.TextDisplay.Align.CODEC - .decode(NbtOps.INSTANCE, nbt.get("alignment")) -- .resultOrPartial(Util.prefix("Display entity", Display.LOGGER::error)) -+ .result() // Paper - Hide text display error on spawn - .map(Pair::getFirst); - if (optional.isPresent()) { - b = switch ((Display.TextDisplay.Align)optional.get()) { diff --git a/patches/unapplied/server/0801-Fix-inventories-returning-null-Locations.patch b/patches/unapplied/server/0801-Fix-inventories-returning-null-Locations.patch deleted file mode 100644 index 23413d6b03..0000000000 --- a/patches/unapplied/server/0801-Fix-inventories-returning-null-Locations.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Wed, 15 Mar 2023 18:29:45 -0700 -Subject: [PATCH] Fix inventories returning null Locations - -Wandering Trader, AbstractHorse, Beacon and Composter inventories returned null locations -when a block or entity location is readily available - -Co-authored-by: Lukas Planz <[email protected]> - -diff --git a/src/main/java/net/minecraft/world/SimpleContainer.java b/src/main/java/net/minecraft/world/SimpleContainer.java -index c26161784359ea167e11de8aa58eda3b4851059c..6632cf24ebe6d147950a1fdb876660937da86b73 100644 ---- a/src/main/java/net/minecraft/world/SimpleContainer.java -+++ b/src/main/java/net/minecraft/world/SimpleContainer.java -@@ -63,6 +63,16 @@ public class SimpleContainer implements Container, StackedContentsCompatible { - - @Override - public Location getLocation() { -+ // Paper start - Fix inventories returning null Locations -+ // When the block inventory does not have a tile state that implements getLocation, e. g. composters -+ if (this.bukkitOwner instanceof org.bukkit.inventory.BlockInventoryHolder blockInventoryHolder) { -+ return blockInventoryHolder.getBlock().getLocation(); -+ } -+ // When the bukkit owner is a bukkit entity, but does not implement Container itself, e. g. horses -+ if (this.bukkitOwner instanceof org.bukkit.entity.Entity entity) { -+ return entity.getLocation(); -+ } -+ // Paper end - Fix inventories returning null Locations - return null; - } - -diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -index 8b0ebf659f6b219ce2a5d10b0d79f9b89b47c911..a735aeeb59f79154ce797c6e2f5600305f46d217 100644 ---- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -+++ b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java -@@ -52,6 +52,12 @@ public class BeaconMenu extends AbstractContainerMenu { - public int getMaxStackSize() { - return 1; - } -+ // Paper start - Fix inventories returning null Locations -+ @Override -+ public org.bukkit.Location getLocation() { -+ return context.getLocation(); -+ } -+ // Paper end - Fix inventories returning null Locations - }; - checkContainerDataCount(propertyDelegate, 3); - this.beaconData = propertyDelegate; -diff --git a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java -index 7cc96b62f6bacdb44a37d74db214bd0e11c4d503..9140fab07aab32065f7a3b5d13dd17d61dc6d646 100644 ---- a/src/main/java/net/minecraft/world/inventory/MerchantContainer.java -+++ b/src/main/java/net/minecraft/world/inventory/MerchantContainer.java -@@ -65,7 +65,7 @@ public class MerchantContainer implements Container { - - @Override - public Location getLocation() { -- return (this.merchant instanceof Villager) ? ((Villager) this.merchant).getBukkitEntity().getLocation() : null; -+ return (this.merchant instanceof AbstractVillager) ? ((AbstractVillager) this.merchant).getBukkitEntity().getLocation() : null; // Paper - Fix inventories returning null Locations - } - // CraftBukkit end - diff --git a/patches/unapplied/server/0802-Add-Shearable-API.patch b/patches/unapplied/server/0802-Add-Shearable-API.patch deleted file mode 100644 index 3cf9cf3015..0000000000 --- a/patches/unapplied/server/0802-Add-Shearable-API.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Owen1212055 <[email protected]> -Date: Sun, 17 Oct 2021 15:39:48 -0400 -Subject: [PATCH] Add Shearable API - - -diff --git a/src/main/java/io/papermc/paper/entity/PaperShearable.java b/src/main/java/io/papermc/paper/entity/PaperShearable.java -new file mode 100644 -index 0000000000000000000000000000000000000000..bcf254e3c81cf1e401bddc850fb24ad29dcc127c ---- /dev/null -+++ b/src/main/java/io/papermc/paper/entity/PaperShearable.java -@@ -0,0 +1,21 @@ -+package io.papermc.paper.entity; -+ -+import io.papermc.paper.adventure.PaperAdventure; -+import net.kyori.adventure.sound.Sound; -+import net.minecraft.world.entity.Shearable; -+import org.jetbrains.annotations.NotNull; -+ -+public interface PaperShearable extends io.papermc.paper.entity.Shearable { -+ -+ Shearable getHandle(); -+ -+ @Override -+ default boolean readyToBeSheared() { -+ return this.getHandle().readyForShearing(); -+ } -+ -+ @Override -+ default void shear(@NotNull Sound.Source source) { -+ this.getHandle().shear(PaperAdventure.asVanilla(source)); -+ } -+} -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java -index 0139e85c0751564bb4d2847b7b2e48f75fee9e53..e8e4704304504e69c7964dcd4df8ce5db9e92bf6 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java -@@ -4,7 +4,7 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.Bogged; - import org.bukkit.entity.Skeleton; - --public class CraftBogged extends CraftAbstractSkeleton implements Bogged { -+public class CraftBogged extends CraftAbstractSkeleton implements Bogged, io.papermc.paper.entity.PaperShearable { // Paper - Shear API - - public CraftBogged(CraftServer server, net.minecraft.world.entity.monster.Bogged entity) { - super(server, entity); -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -index 986f7b18112ef183de3bbff269a92bf6ac945477..9cc81bcccbf1141f66fedada1359b7c0dfa8e22a 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java -@@ -14,7 +14,7 @@ import org.bukkit.entity.MushroomCow; - import org.bukkit.potion.PotionEffect; - import org.bukkit.potion.PotionEffectType; - --public class CraftMushroomCow extends CraftCow implements MushroomCow { -+public class CraftMushroomCow extends CraftCow implements MushroomCow, io.papermc.paper.entity.PaperShearable { // Paper - public CraftMushroomCow(CraftServer server, net.minecraft.world.entity.animal.MushroomCow entity) { - super(server, entity); - } -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java -index 030bf7b6312799231d0b614ba5c84fec23c276e3..37291d7ad9fdf0fe78894f82a418f40bb581f58b 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSheep.java -@@ -4,7 +4,7 @@ import org.bukkit.DyeColor; - import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.Sheep; - --public class CraftSheep extends CraftAnimals implements Sheep { -+public class CraftSheep extends CraftAnimals implements Sheep, io.papermc.paper.entity.PaperShearable { // Paper - public CraftSheep(CraftServer server, net.minecraft.world.entity.animal.Sheep entity) { - super(server, entity); - } -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -index 1e9807b8f468742d208f817e22d7625106fc1b58..4ce2373ff71c3c1b8951646e057587a3ab09e145 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowman.java -@@ -4,7 +4,7 @@ import net.minecraft.world.entity.animal.SnowGolem; - import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.entity.Snowman; - --public class CraftSnowman extends CraftGolem implements Snowman, com.destroystokyo.paper.entity.CraftRangedEntity<SnowGolem> { // Paper -+public class CraftSnowman extends CraftGolem implements Snowman, com.destroystokyo.paper.entity.CraftRangedEntity<SnowGolem>, io.papermc.paper.entity.PaperShearable { // Paper - public CraftSnowman(CraftServer server, SnowGolem entity) { - super(server, entity); - } -diff --git a/src/test/java/io/papermc/paper/entity/ShearableTest.java b/src/test/java/io/papermc/paper/entity/ShearableTest.java -new file mode 100644 -index 0000000000000000000000000000000000000000..709b90f0cd01a4508d44f2e971f5bf9785d78ae5 ---- /dev/null -+++ b/src/test/java/io/papermc/paper/entity/ShearableTest.java -@@ -0,0 +1,30 @@ -+package io.papermc.paper.entity; -+ -+import com.destroystokyo.paper.entity.ai.MobGoalHelper; -+import io.github.classgraph.ClassGraph; -+import io.github.classgraph.ScanResult; -+import java.util.List; -+import net.minecraft.world.entity.Mob; -+import net.minecraft.world.entity.Shearable; -+import org.bukkit.support.environment.Normal; -+import org.junit.jupiter.api.Assertions; -+import org.junit.jupiter.params.ParameterizedTest; -+import org.junit.jupiter.params.provider.MethodSource; -+ -+@Normal -+class ShearableTest { -+ -+ static List<Class<Shearable>> nmsShearables() { -+ try (final ScanResult result = new ClassGraph().enableClassInfo().whitelistPackages("net.minecraft.world.entity").scan()) { -+ return result.getClassesImplementing(Shearable.class.getName()).loadClasses(Shearable.class); -+ } -+ } -+ -+ @SuppressWarnings("unchecked") -+ @ParameterizedTest -+ @MethodSource("nmsShearables") -+ void ensureImplementsShearable(final Class<? extends Shearable> shearableNmsClass) { -+ final Class<? extends org.bukkit.entity.Mob> bukkitClass = MobGoalHelper.toBukkitClass((Class<? extends Mob>) shearableNmsClass); -+ Assertions.assertTrue(io.papermc.paper.entity.Shearable.class.isAssignableFrom(bukkitClass), bukkitClass.getName() + " does not implement Shearable"); -+ } -+} diff --git a/patches/unapplied/server/0803-Fix-SpawnEggMeta-get-setSpawnedType.patch b/patches/unapplied/server/0803-Fix-SpawnEggMeta-get-setSpawnedType.patch deleted file mode 100644 index 254a94df3a..0000000000 --- a/patches/unapplied/server/0803-Fix-SpawnEggMeta-get-setSpawnedType.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Thu, 23 Feb 2023 13:19:13 -0800 -Subject: [PATCH] Fix SpawnEggMeta#get/setSpawnedType - - -diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java -index ea9937ad27817112f71e8a0a816865961ce19a61..6c2c3b514be0dab47f3e44f65bdc6a3574e59b7c 100644 ---- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java -+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java -@@ -94,6 +94,30 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta { - public void setSpawnedType(EntityType type) { - throw new UnsupportedOperationException("Must change item type to set spawned type"); - } -+ // Paper start -+ @Override -+ public EntityType getCustomSpawnedType() { -+ return java.util.Optional.ofNullable(this.entityTag) -+ .map(tag -> tag.getString(ENTITY_ID.NBT)) -+ .map(net.minecraft.resources.ResourceLocation::tryParse) -+ .map(key -> key.getNamespace().equals("minecraft") ? EntityType.fromName(key.getPath()) : null) -+ .orElse(null); -+ } -+ -+ @Override -+ public void setCustomSpawnedType(final EntityType type) { -+ if (type == null) { -+ if (this.entityTag != null) { -+ this.entityTag.remove(ENTITY_ID.NBT); -+ } -+ } else { -+ if (this.entityTag == null) { -+ this.entityTag = new CompoundTag(); -+ } -+ this.entityTag.putString(ENTITY_ID.NBT, type.key().toString()); -+ } -+ } -+ // Paper end - - @Override - public EntitySnapshot getSpawnedEntity() { diff --git a/patches/unapplied/server/0804-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch b/patches/unapplied/server/0804-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch deleted file mode 100644 index d90e599897..0000000000 --- a/patches/unapplied/server/0804-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sun, 19 Mar 2023 20:36:22 -0700 -Subject: [PATCH] Fix crash relating to bad recipes in furnace-like tile - entities - - -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 f1a7054a0ee1842e78338d8984f151b24c352849..65ab9b22f724877b68f4f25aad2831e2cb080b19 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 -@@ -616,6 +616,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit - Entry<ResourceLocation> entry = (Entry) objectiterator.next(); - - worldserver.getRecipeManager().byKey((ResourceLocation) entry.getKey()).ifPresent((recipeholder) -> { -+ if (!(recipeholder.value() instanceof AbstractCookingRecipe)) return; // Paper - don't process non-cooking recipes - list.add(recipeholder); - AbstractFurnaceBlockEntity.createExperience(worldserver, vec3d, entry.getIntValue(), ((AbstractCookingRecipe) recipeholder.value()).getExperience(), blockposition, entityplayer, itemstack, amount); // CraftBukkit - }); diff --git a/patches/unapplied/server/0805-Treat-sequence-violations-like-they-should-be.patch b/patches/unapplied/server/0805-Treat-sequence-violations-like-they-should-be.patch deleted file mode 100644 index e0fce8efce..0000000000 --- a/patches/unapplied/server/0805-Treat-sequence-violations-like-they-should-be.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder <[email protected]> -Date: Thu, 30 Mar 2023 03:13:58 +0100 -Subject: [PATCH] Treat sequence violations like they should be - - -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a6f58438badb0bdeab67706f4a8e519b202623fe..5a710de60a57c8af4eb083e17f03e801858dc2d9 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1976,6 +1976,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - - public void ackBlockChangesUpTo(int sequence) { - if (sequence < 0) { -+ this.disconnect(Component.literal("Expected packet sequence nr >= 0"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - Treat sequence violations like they should be - throw new IllegalArgumentException("Expected packet sequence nr >= 0"); - } else { - this.ackBlockChangesUpTo = Math.max(sequence, this.ackBlockChangesUpTo); diff --git a/patches/unapplied/server/0806-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/unapplied/server/0806-Prevent-causing-expired-keys-from-impacting-new-join.patch deleted file mode 100644 index ee811c8ba6..0000000000 --- a/patches/unapplied/server/0806-Prevent-causing-expired-keys-from-impacting-new-join.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder <[email protected]> -Date: Mon, 3 Apr 2023 08:55:52 +0100 -Subject: [PATCH] Prevent causing expired keys from impacting new joins - - -diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -index 68c062cbaa030d62d97c9c003651f8fc17a00a6b..6247a21c9c391abf1f6db3482c659593e4f29355 100644 ---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java -@@ -113,7 +113,15 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke - }), - INITIALIZE_CHAT( - (serialized, buf) -> serialized.chatSession = buf.readNullable(RemoteChatSession.Data::read), -- (buf, entry) -> buf.writeNullable(entry.chatSession, RemoteChatSession.Data::write) -+ // Paper start - Prevent causing expired keys from impacting new joins -+ (buf, entry) -> { -+ RemoteChatSession.Data chatSession = entry.chatSession; -+ if (chatSession != null && chatSession.profilePublicKey().hasExpired()) { -+ chatSession = null; -+ } -+ buf.writeNullable(chatSession, RemoteChatSession.Data::write); -+ } -+ // Paper end - Prevent causing expired keys from impacting new joins - ), - UPDATE_GAME_MODE((serialized, buf) -> serialized.gameMode = GameType.byId(buf.readVarInt()), (buf, entry) -> buf.writeVarInt(entry.gameMode().getId())), - UPDATE_LISTED((serialized, buf) -> serialized.listed = buf.readBoolean(), (buf, entry) -> buf.writeBoolean(entry.listed())), -diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 5a710de60a57c8af4eb083e17f03e801858dc2d9..db9c04d74475e00983cc9df74d615e4b68f83688 100644 ---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -295,6 +295,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - private int knownMovePacketCount; - @Nullable - private RemoteChatSession chatSession; -+ private boolean hasLoggedExpiry = false; // Paper - Prevent causing expired keys from impacting new joins - private SignedMessageChain.Decoder signedMessageDecoder; - private final LastSeenMessagesValidator lastSeenMessages = new LastSeenMessagesValidator(20); - private final MessageSignatureCache messageSignatureCache = MessageSignatureCache.createDefault(); -@@ -402,6 +403,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - this.disconnect((Component) Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause - } - -+ // Paper start - Prevent causing expired keys from impacting new joins -+ if (!hasLoggedExpiry && this.chatSession != null && this.chatSession.profilePublicKey().data().hasExpired()) { -+ LOGGER.info("Player profile key for {} has expired!", this.player.getName().getString()); -+ hasLoggedExpiry = true; -+ } -+ // Paper end - Prevent causing expired keys from impacting new joins -+ - } - - private int getMaximumFlyingTicks(Entity vehicle) { -@@ -3434,6 +3442,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl - - private void resetPlayerChatState(RemoteChatSession session) { - this.chatSession = session; -+ this.hasLoggedExpiry = false; // Paper - Prevent causing expired keys from impacting new joins - this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID()); - this.chatMessageChain.append(() -> { - this.player.setChatSession(session); diff --git a/patches/unapplied/server/0807-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch b/patches/unapplied/server/0807-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch deleted file mode 100644 index 3306163498..0000000000 --- a/patches/unapplied/server/0807-Prevent-GameEvents-being-fired-from-unloaded-chunks.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder <[email protected]> -Date: Wed, 5 Apr 2023 20:15:47 +0100 -Subject: [PATCH] Prevent GameEvents being fired from unloaded chunks - - -diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 07f7752651095abdd9e9408a419aed7d78173d3a..fd4d1cab675b7b423ac0fdf9a8c9f472ddc68c36 100644 ---- a/src/main/java/net/minecraft/server/level/ServerLevel.java -+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1372,6 +1372,11 @@ public class ServerLevel extends Level implements WorldGenLevel { - - @Override - public void gameEvent(Holder<GameEvent> event, Vec3 emitterPos, GameEvent.Context emitter) { -+ // Paper start - Prevent GameEvents being fired from unloaded chunks -+ if (this.getChunkIfLoadedImmediately((Mth.floor(emitterPos.x) >> 4), (Mth.floor(emitterPos.z) >> 4)) == null) { -+ return; -+ } -+ // Paper end - Prevent GameEvents being fired from unloaded chunks - this.gameEventDispatcher.post(event, emitterPos, emitter); - } - diff --git a/patches/unapplied/server/0808-Use-array-for-gamerule-storage.patch b/patches/unapplied/server/0808-Use-array-for-gamerule-storage.patch deleted file mode 100644 index 194ff8f15b..0000000000 --- a/patches/unapplied/server/0808-Use-array-for-gamerule-storage.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Paul Sauve <[email protected]> -Date: Sun, 9 May 2021 16:49:49 -0500 -Subject: [PATCH] Use array for gamerule storage - - -diff --git a/src/main/java/net/minecraft/world/level/GameRules.java b/src/main/java/net/minecraft/world/level/GameRules.java -index 51e560d7856f230c5aa2dc32706c3a4996720aa5..89e327bc3a45879fe68887c7aadb077f31a770eb 100644 ---- a/src/main/java/net/minecraft/world/level/GameRules.java -+++ b/src/main/java/net/minecraft/world/level/GameRules.java -@@ -122,6 +122,7 @@ public class GameRules { - worldserver.setDefaultSpawnPos(worldserver.getSharedSpawnPos(), worldserver.getSharedSpawnAngle()); - })); - private final Map<GameRules.Key<?>, GameRules.Value<?>> rules; -+ private final GameRules.Value<?>[] gameruleArray; // Paper - Perf: Use array for gamerule storage - - private static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) { - GameRules.Key<T> gamerules_gamerulekey = new GameRules.Key<>(name, category); -@@ -140,17 +141,30 @@ public class GameRules { - } - - public GameRules() { -- this.rules = (Map) GameRules.GAME_RULE_TYPES.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry) -> { -+ // Paper start - Perf: Use array for gamerule storage -+ this((Map) GameRules.GAME_RULE_TYPES.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry) -> { - return ((GameRules.Type) entry.getValue()).createRule(); -- })); -+ }))); -+ // Paper end - Perf: Use array for gamerule storage - } - - private GameRules(Map<GameRules.Key<?>, GameRules.Value<?>> rules) { - this.rules = rules; -+ -+ // Paper start - Perf: Use array for gamerule storage -+ int arraySize = rules.keySet().stream().mapToInt(key -> key.gameRuleIndex).max().orElse(-1) + 1; -+ GameRules.Value<?>[] values = new GameRules.Value[arraySize]; -+ -+ for (Entry<GameRules.Key<?>, GameRules.Value<?>> entry : rules.entrySet()) { -+ values[entry.getKey().gameRuleIndex] = entry.getValue(); -+ } -+ -+ this.gameruleArray = values; -+ // Paper end - Perf: Use array for gamerule storage - } - - public <T extends GameRules.Value<T>> T getRule(GameRules.Key<T> key) { -- return (T) this.rules.get(key); // CraftBukkit - decompile error -+ return key == null ? null : (T) this.gameruleArray[key.gameRuleIndex]; // Paper - Perf: Use array for gamerule storage - } - - public CompoundTag createTag() { -@@ -209,6 +223,10 @@ public class GameRules { - } - - public static final class Key<T extends GameRules.Value<T>> { -+ // Paper start - Perf: Use array for gamerule storage -+ private static int lastGameRuleIndex = 0; -+ public final int gameRuleIndex = lastGameRuleIndex++; -+ // Paper end - Perf: Use array for gamerule storage - - final String id; - private final GameRules.Category category; diff --git a/patches/unapplied/server/0809-Fix-a-couple-of-upstream-bed-issues.patch b/patches/unapplied/server/0809-Fix-a-couple-of-upstream-bed-issues.patch deleted file mode 100644 index 665db524c5..0000000000 --- a/patches/unapplied/server/0809-Fix-a-couple-of-upstream-bed-issues.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sun, 9 Apr 2023 21:11:58 -0700 -Subject: [PATCH] Fix a couple of upstream bed issues - -Upstream incorrectly skipped explosion logic if -the bed was occupied and added a "feature" where -if you set your spawn in a respawn anchor world -but then replaced it with a bed, you could respawn -at the bed in that world. - -diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java -index 18b9a62613c08eb5bf63ae26565b0e91e1f44d39..85d598c3354ee62f0fd1b26e485e0084967c0380 100644 ---- a/src/main/java/net/minecraft/world/level/block/BedBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -107,6 +107,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - world.explode((Entity) null, world.damageSources().badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); - return InteractionResult.SUCCESS; - } else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) { -+ if (!BedBlock.canSetSpawn(world)) return this.explodeBed(state, world, pos); // Paper - check explode first - if (!this.kickVillagerOutOfBed(world, pos)) { - player.displayClientMessage(Component.translatable("block.minecraft.bed.occupied"), true); - } -@@ -164,8 +165,7 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - // CraftBukkit end - - public static boolean canSetSpawn(Level world) { -- // CraftBukkit - moved world and biome check into EntityHuman -- return true || world.dimensionType().bedWorks(); -+ return world.dimensionType().bedWorks(); // Paper - actually check if the bed works - } - - private boolean kickVillagerOutOfBed(Level world, BlockPos pos) { diff --git a/patches/unapplied/server/0810-Fix-demo-flag-not-enabling-demo-mode.patch b/patches/unapplied/server/0810-Fix-demo-flag-not-enabling-demo-mode.patch deleted file mode 100644 index d64dd23e37..0000000000 --- a/patches/unapplied/server/0810-Fix-demo-flag-not-enabling-demo-mode.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Warrior <[email protected]> -Date: Fri, 7 Apr 2023 20:11:17 +0200 -Subject: [PATCH] Fix demo flag not enabling demo mode - -https://github.com/PaperMC/Paper/issues/9046 - -diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 13e1a914d4523f1c192db2a9a1ee6522e0ee27da..c33f85b570f159ab465b5a10a8044a81f2797f43 100644 ---- a/src/main/java/net/minecraft/server/Main.java -+++ b/src/main/java/net/minecraft/server/Main.java -@@ -325,7 +325,9 @@ public class Main { - - /* - dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec11)); -- dedicatedserver1.setDemo(optionset.has(optionspec2)); -+ */ -+ dedicatedserver1.setDemo(optionset.has("demo")); // Paper -+ /* - dedicatedserver1.setId((String) optionset.valueOf(optionspec12)); - */ - boolean flag2 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui"); diff --git a/patches/unapplied/server/0811-Add-Mob-Experience-reward-API.patch b/patches/unapplied/server/0811-Add-Mob-Experience-reward-API.patch deleted file mode 100644 index f82f765beb..0000000000 --- a/patches/unapplied/server/0811-Add-Mob-Experience-reward-API.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: GodOfPro <[email protected]> -Date: Tue, 11 Apr 2023 16:31:39 +0430 -Subject: [PATCH] Add Mob Experience reward API - - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 921594a78ea511337434b29b5bc1a037eb30992c..deb66c04abefb4a88521483db1612e494bd27164 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -1,6 +1,7 @@ - package org.bukkit.craftbukkit.entity; - - import com.google.common.base.Preconditions; -+import net.minecraft.server.level.ServerLevel; - import net.minecraft.sounds.SoundEvent; - import org.bukkit.Sound; - import org.bukkit.craftbukkit.CraftLootTable; -@@ -167,4 +168,11 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { - this.getHandle().setAggressive(aggressive); - } - // Paper end -+ -+ // Paper start -+ @Override -+ public int getPossibleExperienceReward() { -+ return getHandle().getExperienceReward((ServerLevel) this.getHandle().level(), null); -+ } -+ // Paper end - } diff --git a/patches/unapplied/server/0812-Break-redstone-on-top-of-trap-doors-early.patch b/patches/unapplied/server/0812-Break-redstone-on-top-of-trap-doors-early.patch deleted file mode 100644 index 11c427e808..0000000000 --- a/patches/unapplied/server/0812-Break-redstone-on-top-of-trap-doors-early.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Spottedleaf <[email protected]> -Date: Mon, 1 May 2023 18:31:26 -0700 -Subject: [PATCH] Break redstone on top of trap doors early - -This logic hooks into the neighbour update which should be invoked -as a result of redstone powering the trap door. - -diff --git a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java -index 82e38b01446d35aa9745be6ff3c7647b46379682..336fcf4af0ffb416b5595a9e65172f36cc36aaa3 100644 ---- a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java -@@ -153,7 +153,26 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW - flag1 = eventRedstone.getNewCurrent() > 0; - } - // CraftBukkit end -- if ((Boolean) state.getValue(TrapDoorBlock.OPEN) != flag1) { -+ // Paper start - break redstone on trapdoors early -+ boolean open = (Boolean) state.getValue(TrapDoorBlock.OPEN) != flag1; -+ // note: this must run before any state for this block/its neighborus are written to the world -+ // we allow the redstone event to fire so that plugins can block -+ if (flag1 && open) { // if we are now powered and it caused the trap door to open -+ // in this case, first check for the redstone on top first -+ BlockPos abovePos = pos.above(); -+ BlockState above = world.getBlockState(abovePos); -+ if (above.getBlock() instanceof RedStoneWireBlock) { -+ world.setBlock(abovePos, Blocks.AIR.defaultBlockState(), Block.UPDATE_CLIENTS | Block.UPDATE_NEIGHBORS); -+ Block.popResource(world, abovePos, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.REDSTONE)); -+ // now check that this didn't change our state -+ if (world.getBlockState(pos) != state) { -+ // our state was changed, so we cannot propagate this update -+ return; -+ } -+ } -+ } -+ if (open) { -+ // Paper end - break redstone on trapdoors early - state = (BlockState) state.setValue(TrapDoorBlock.OPEN, flag1); - this.playSound((Player) null, world, pos, flag1); - } diff --git a/patches/unapplied/server/0813-Avoid-Lazy-Initialization-for-Enum-Fields.patch b/patches/unapplied/server/0813-Avoid-Lazy-Initialization-for-Enum-Fields.patch deleted file mode 100644 index becde16ce8..0000000000 --- a/patches/unapplied/server/0813-Avoid-Lazy-Initialization-for-Enum-Fields.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Owen1212055 <[email protected]> -Date: Sun, 14 May 2023 00:47:28 -0400 -Subject: [PATCH] Avoid Lazy Initialization for Enum Fields - -This patch is meant to get rid of any instances of lazy initialization that Minecraft introduces for enums. -This has the possibility to create race condition issues, and generally don't make sense to be lazily done anyways. - -diff --git a/src/main/java/com/mojang/math/OctahedralGroup.java b/src/main/java/com/mojang/math/OctahedralGroup.java -index 0a3b6b8e250bd35530c05a1cdaf2eb8a9af4c72b..9aa82fc757c67a9456b2bdec744c0cb474d64df6 100644 ---- a/src/main/java/com/mojang/math/OctahedralGroup.java -+++ b/src/main/java/com/mojang/math/OctahedralGroup.java -@@ -110,6 +110,7 @@ public enum OctahedralGroup implements StringRepresentable { - this.permutation = axisTransformation; - this.transformation = new Matrix3f().scaling(flipX ? -1.0F : 1.0F, flipY ? -1.0F : 1.0F, flipZ ? -1.0F : 1.0F); - this.transformation.mul(axisTransformation.transformation()); -+ this.initializeRotationDirections(); // Paper - Avoid Lazy Initialization for Enum Fields - } - - private BooleanList packInversions() { -@@ -138,7 +139,7 @@ public enum OctahedralGroup implements StringRepresentable { - return this.name; - } - -- public Direction rotate(Direction direction) { -+ public void initializeRotationDirections() { // Paper - Avoid Lazy Initialization for Enum Fields - if (this.rotatedDirections == null) { - this.rotatedDirections = Maps.newEnumMap(Direction.class); - Direction.Axis[] axiss = Direction.Axis.values(); -@@ -153,6 +154,10 @@ public enum OctahedralGroup implements StringRepresentable { - } - } - -+ // Paper start - Avoid Lazy Initialization for Enum Fields -+ } -+ public Direction rotate(Direction direction) { -+ // Paper end - Avoid Lazy Initialization for Enum Fields - return this.rotatedDirections.get(direction); - } - diff --git a/patches/unapplied/server/0814-More-accurate-isInOpenWater-impl.patch b/patches/unapplied/server/0814-More-accurate-isInOpenWater-impl.patch deleted file mode 100644 index 6e110094dd..0000000000 --- a/patches/unapplied/server/0814-More-accurate-isInOpenWater-impl.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Warrior <[email protected]> -Date: Sun, 7 May 2023 22:33:50 +0200 -Subject: [PATCH] More accurate isInOpenWater impl - -For fishing hooks, the openWater field is true by default, and only calculated when a "fish" is approaching the bobber. -This patch changes the API impl to calculate the open water state itself instead of returning this field. - -Relevant link: https://github.com/PaperMC/Paper/issues/9131 - -== AT == -public net.minecraft.world.entity.projectile.FishingHook calculateOpenWater(Lnet/minecraft/core/BlockPos;)Z -public net.minecraft.world.entity.projectile.FishingHook outOfWaterTime - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -index 9d8f4b7176e60180565e3134a14ecf19060f2621..e0d65df2e5b4c14abeb89a5f72cc2d9fa034dcf5 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -@@ -164,7 +164,7 @@ public class CraftFishHook extends CraftProjectile implements FishHook { - - @Override - public boolean isInOpenWater() { -- return this.getHandle().isOpenWaterFishing(); -+ return this.getHandle().outOfWaterTime < 10 && this.getHandle().calculateOpenWater(this.getHandle().blockPosition()); // Paper - isOpenWaterFishing is only calculated when a "fish" is approaching the hook - } - - @Override diff --git a/patches/unapplied/server/0815-Expand-PlayerItemMendEvent.patch b/patches/unapplied/server/0815-Expand-PlayerItemMendEvent.patch deleted file mode 100644 index 289fae7adb..0000000000 --- a/patches/unapplied/server/0815-Expand-PlayerItemMendEvent.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Thu, 20 Jan 2022 18:11:20 -0800 -Subject: [PATCH] Expand PlayerItemMendEvent - - -diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index a758b2456acac23095fe4619ae10300a034cb460..a58ff67052fb5f33782f8b5c83465ec03ef1d073 100644 ---- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -354,7 +354,10 @@ public class ExperienceOrb extends Entity { - int j = EnchantmentHelper.modifyDurabilityToRepairFromXp(player.serverLevel(), itemstack, amount); - int k = Math.min(j, itemstack.getDamageValue()); - // CraftBukkit start -- org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), k); -+ // Paper start - mending event -+ final int consumedExperience = k > 0 ? k * amount / j : 0; -+ org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, optional.get().inSlot(), k, consumedExperience); -+ // Paper end - mending event - k = event.getRepairAmount(); - if (event.isCancelled()) { - return amount; -@@ -363,7 +366,7 @@ public class ExperienceOrb extends Entity { - - itemstack.setDamageValue(itemstack.getDamageValue() - k); - if (k > 0) { -- int l = amount - k * amount / j; -+ int l = amount - k * amount / j; // Paper - diff on change - expand PlayerMendEvents - - if (l > 0) { - // this.value = l; // CraftBukkit - update exp value of orb for PlayerItemMendEvent calls // Paper - the value field should not be mutated here because it doesn't take "count" into account -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 06a3ccb90f23fc357e5cbc6e9173baab4b218955..3945a6ab723deee3ec3ebb5fbc726ce16bbca411 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1853,11 +1853,12 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - handle.serverLevel(), itemstack, amount - ); - int i = Math.min(possibleDurabilityFromXp, itemstack.getDamageValue()); -- org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.get().inSlot(), i); -+ final int consumedExperience = i * amount / possibleDurabilityFromXp; // Paper - taken from ExperienceOrb#repairPlayerItems -+ org.bukkit.event.player.PlayerItemMendEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemMendEvent(handle, orb, itemstack, stackEntry.get().inSlot(), i, consumedExperience); - i = event.getRepairAmount(); - orb.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); - if (!event.isCancelled()) { -- amount -= i * amount / possibleDurabilityFromXp; -+ amount -= consumedExperience; // Use previously computed variable to reduce diff on change. - itemstack.setDamageValue(itemstack.getDamageValue() - i); - } - } -diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a0b387ddf3cc1e3473c6b35175ac8b68c717cfbe..9586837f25464396c0695e87fa278c91ca90183a 100644 ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1286,10 +1286,10 @@ public class CraftEventFactory { - return event; - } - -- public static PlayerItemMendEvent callPlayerItemMendEvent(net.minecraft.world.entity.player.Player entity, net.minecraft.world.entity.ExperienceOrb orb, net.minecraft.world.item.ItemStack nmsMendedItem, net.minecraft.world.entity.EquipmentSlot slot, int repairAmount) { -+ public static PlayerItemMendEvent callPlayerItemMendEvent(net.minecraft.world.entity.player.Player entity, net.minecraft.world.entity.ExperienceOrb orb, net.minecraft.world.item.ItemStack nmsMendedItem, net.minecraft.world.entity.EquipmentSlot slot, int repairAmount, int consumedExperience) { // Paper - Expand PlayerItemMendEvent - Player player = (Player) entity.getBukkitEntity(); - org.bukkit.inventory.ItemStack bukkitStack = CraftItemStack.asCraftMirror(nmsMendedItem); -- PlayerItemMendEvent event = new PlayerItemMendEvent(player, bukkitStack, CraftEquipmentSlot.getSlot(slot), (ExperienceOrb) orb.getBukkitEntity(), repairAmount); -+ PlayerItemMendEvent event = new PlayerItemMendEvent(player, bukkitStack, CraftEquipmentSlot.getSlot(slot), (ExperienceOrb) orb.getBukkitEntity(), repairAmount, consumedExperience); // Paper - Expand PlayerItemMendEvent - Bukkit.getPluginManager().callEvent(event); - return event; - } |