diff --git a/patches/unapplied/server/Ability-to-control-player-s-insomnia-and-phantoms.patch b/patches/server/Ability-to-control-player-s-insomnia-and-phantoms.patch similarity index 100% rename from patches/unapplied/server/Ability-to-control-player-s-insomnia-and-phantoms.patch rename to patches/server/Ability-to-control-player-s-insomnia-and-phantoms.patch diff --git a/patches/unapplied/server/Add-EntityToggleSitEvent.patch b/patches/server/Add-EntityToggleSitEvent.patch similarity index 97% rename from patches/unapplied/server/Add-EntityToggleSitEvent.patch rename to patches/server/Add-EntityToggleSitEvent.patch index c1e5f6a28d..8655cc3b4a 100644 --- a/patches/unapplied/server/Add-EntityToggleSitEvent.patch +++ b/patches/server/Add-EntityToggleSitEvent.patch @@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void sitDown() { - if (!this.isCamelSitting()) { + if (!this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), true).callEvent()) { // Paper - Add EntityToggleSitEvent - this.playSound(SoundEvents.CAMEL_SIT, 1.0F, this.getVoicePitch()); + this.makeSound(SoundEvents.CAMEL_SIT); this.setPose(Pose.SITTING); this.gameEvent(GameEvent.ENTITY_ACTION); @@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl @@ -87,7 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public void standUp() { - if (this.isCamelSitting()) { + if (this.isCamelSitting() && new io.papermc.paper.event.entity.EntityToggleSitEvent(this.getBukkitEntity(), false).callEvent()) { // Paper - Add EntityToggleSitEvent - this.playSound(SoundEvents.CAMEL_STAND, 1.0F, this.getVoicePitch()); + this.makeSound(SoundEvents.CAMEL_STAND); this.setPose(Pose.STANDING); this.gameEvent(GameEvent.ENTITY_ACTION); @@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl diff --git a/patches/unapplied/server/Add-Moving-Piston-API.patch b/patches/server/Add-Moving-Piston-API.patch similarity index 88% rename from patches/unapplied/server/Add-Moving-Piston-API.patch rename to patches/server/Add-Moving-Piston-API.patch index 009cbd9381..ef7762cdb8 100644 --- a/patches/unapplied/server/Add-Moving-Piston-API.patch +++ b/patches/server/Add-Moving-Piston-API.patch @@ -8,8 +8,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java b index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java -@@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.block; - import net.minecraft.world.level.block.piston.PistonMovingBlockEntity; +@@ -0,0 +0,0 @@ import net.minecraft.world.level.block.piston.PistonMovingBlockEntity; + import org.bukkit.Location; import org.bukkit.World; -public class CraftMovingPiston extends CraftBlockEntityState { @@ -18,8 +18,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public CraftMovingPiston(World world, PistonMovingBlockEntity tileEntity) { super(world, tileEntity); @@ -0,0 +0,0 @@ public class CraftMovingPiston extends CraftBlockEntityState event, Vec3 emitterPos, GameEvent.Context emitter) { - // Used by BlockComposter + // Used by ComposterBlock } diff --git a/patches/unapplied/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch b/patches/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch similarity index 100% rename from patches/unapplied/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch rename to patches/server/Fix-EntityArgument-suggestion-permissions-to-align-w.patch diff --git a/patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch similarity index 89% rename from patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch rename to patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch index 3d99087461..5183a0954e 100644 --- a/patches/unapplied/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch +++ b/patches/server/Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch @@ -9,10 +9,10 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess pluginManager.callEvent(entityCombustEvent); if (!entityCombustEvent.isCancelled()) { - this.setSecondsOnFire(entityCombustEvent.getDuration(), false); + this.igniteForSeconds(entityCombustEvent.getDuration(), false); + // Paper start - fix EntityCombustEvent cancellation + } else { + this.setRemainingFireTicks(this.remainingFireTicks - 1); @@ -27,7 +27,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public abstract class BaseFireBlock extends Block { if (!event.isCancelled()) { - entity.setSecondsOnFire(event.getDuration(), false); + entity.igniteForSeconds(event.getDuration(), false); + // Paper start - fix EntityCombustEvent cancellation + } else { + entity.setRemainingFireTicks(entity.getRemainingFireTicks() - 1); diff --git a/patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch similarity index 84% rename from patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch rename to patches/server/Fix-a-bunch-of-vanilla-bugs.patch index 0945ee6beb..774afc85cd 100644 --- a/patches/unapplied/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -3,9 +3,6 @@ From: Jake Potrebic Date: Mon, 11 Jul 2022 11:56:41 -0700 Subject: [PATCH] Fix a bunch of vanilla bugs -https://bugs.mojang.com/browse/MC-253884 - show raid entity event to all tracking players - https://bugs.mojang.com/browse/MC-253721 wrong msg for opping multiple players @@ -49,12 +46,6 @@ https://bugs.mojang.com/browse/MC-123848 https://bugs.mojang.com/browse/MC-84789 Fix wild wolves not considering bones interesting -https://bugs.mojang.com/browse/MC-225381 - Fix overfilled bundles duplicating items / being filled with air - -https://bugs.mojang.com/browse/MC-173303 - Fix leashed pets teleporting to owner when loaded - https://bugs.mojang.com/browse/MC-174630 Fix secondary beacon effect remaining after switching effect @@ -250,19 +241,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.mob.getRandom().nextInt(this.mob.isBaby() ? 50 : 1000) != 0) { return false; } else { -diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java -+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FollowOwnerGoal.java -@@ -0,0 +0,0 @@ public class FollowOwnerGoal extends Goal { - } - - private boolean unableToMove() { -- return this.tamable.isOrderedToSit() || this.tamable.isPassenger() || this.tamable.isLeashed(); -+ return this.tamable.isOrderedToSit() || this.tamable.isPassenger() || this.tamable.isLeashed() || this.tamable.leashInfoTag != null; // Paper - Fix MC-173303 - } - - @Override diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/ai/goal/SwellGoal.java @@ -315,13 +293,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end } - public void equipArmor(Player player, ItemStack stack) { + public void equipBodyArmor(Player player, ItemStack stack) { 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java @@ -0,0 +0,0 @@ public class ItemFrame extends HangingEntity { - } + return (ItemStack) this.getEntityData().get(ItemFrame.DATA_ITEM); } + // Paper start - Fix MC-123848 (spawn item frame drops above block) @@ -332,9 +310,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end + - private void removeFramedMap(ItemStack itemstack) { - this.getFramedMapId().ifPresent((i) -> { - MapItemSavedData worldmap = MapItem.getSavedData(i, this.level()); + @Nullable + public MapId getFramedMapId() { + return (MapId) this.getItem().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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java @@ -344,33 +322,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 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, null); + cat.finalizeSpawn(world, world.getCurrentDifficultyAt(pos), MobSpawnType.NATURAL, null); - cat.moveTo(pos, 0.0F, 0.0F); world.addFreshEntityWithPassengers(cat); return 1; } -diff --git a/src/main/java/net/minecraft/world/entity/raid/Raids.java b/src/main/java/net/minecraft/world/entity/raid/Raids.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/raid/Raids.java -+++ b/src/main/java/net/minecraft/world/entity/raid/Raids.java -@@ -0,0 +0,0 @@ public class Raids extends SavedData { - // CraftBukkit end - } else { - player.removeEffect(MobEffects.BAD_OMEN); -- player.connection.send(new ClientboundEntityEventPacket(player, (byte) 43)); -+ this.level.broadcastEntityEvent(player, net.minecraft.world.entity.EntityEvent.BAD_OMEN_TRIGGERED /* (byte) 43 */); // Paper - Fix MC-253884 - } - - if (flag) { -@@ -0,0 +0,0 @@ public class Raids extends SavedData { - } - // CraftBukkit end - raid.absorbBadOmen(player); -- player.connection.send(new ClientboundEntityEventPacket(player, (byte) 43)); -+ this.level.broadcastEntityEvent(player, net.minecraft.world.entity.EntityEvent.BAD_OMEN_TRIGGERED /* (byte) 43 */); // Paper - Fix MC-253884 - if (!raid.hasFirstWaveSpawned()) { - player.awardStat(Stats.RAID_TRIGGER); - CriteriaTriggers.BAD_OMEN.trigger(player); diff --git a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java b/src/main/java/net/minecraft/world/inventory/BeaconMenu.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/inventory/BeaconMenu.java @@ -378,37 +334,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class BeaconMenu extends AbstractContainerMenu { // Paper end - Add PlayerChangeBeaconEffectEvent - public void updateEffects(Optional primary, Optional secondary) { + public void updateEffects(Optional> primary, Optional> secondary) { + // Paper start - fix MC-174630 - validate secondary power -+ if (secondary.isPresent() && secondary.get() != net.minecraft.world.effect.MobEffects.REGENERATION && (primary.isPresent() && secondary.get() != primary.get())) { ++ if (secondary.isPresent() && secondary.get().value() != net.minecraft.world.effect.MobEffects.REGENERATION && (primary.isPresent() && secondary.get() != primary.get())) { + secondary = Optional.empty(); + } + // Paper end 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/item/BundleItem.java b/src/main/java/net/minecraft/world/item/BundleItem.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/item/BundleItem.java -+++ b/src/main/java/net/minecraft/world/item/BundleItem.java -@@ -0,0 +0,0 @@ public class BundleItem extends Item { - removeOne(stack).ifPresent(removedStack -> add(stack, slot.safeInsert(removedStack))); - } else if (itemStack.getItem().canFitInsideContainerItems()) { - int i = (64 - getContentWeight(stack)) / getWeight(itemStack); -- int j = add(stack, slot.safeTake(itemStack.getCount(), i, player)); -+ int j = add(stack, slot.safeTake(itemStack.getCount(), Math.max(0, i), player)); // Paper - prevent item addition on overfilled bundles - safeTake will yield EMPTY for amount == 0. - if (j > 0) { - this.playInsertSound(player); - } -@@ -0,0 +0,0 @@ public class BundleItem extends Item { - int i = getContentWeight(bundle); - int j = getWeight(stack); - int k = Math.min(stack.getCount(), (64 - i) / j); -- if (k == 0) { -+ if (k <= 0) { // Paper - prevent item addition on overfilled bundles - return 0; - } else { - ListTag listTag = compoundTag.getList("Items", 10); diff --git a/src/main/java/net/minecraft/world/item/SaddleItem.java b/src/main/java/net/minecraft/world/item/SaddleItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/SaddleItem.java diff --git a/patches/unapplied/server/Fix-async-entity-add-due-to-fungus-trees.patch b/patches/server/Fix-async-entity-add-due-to-fungus-trees.patch similarity index 100% rename from patches/unapplied/server/Fix-async-entity-add-due-to-fungus-trees.patch rename to patches/server/Fix-async-entity-add-due-to-fungus-trees.patch diff --git a/patches/unapplied/server/Fix-custom-piglin-loved-items.patch b/patches/server/Fix-custom-piglin-loved-items.patch similarity index 100% rename from patches/unapplied/server/Fix-custom-piglin-loved-items.patch rename to patches/server/Fix-custom-piglin-loved-items.patch diff --git a/patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch b/patches/server/Fix-plugin-loggers-on-server-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-plugin-loggers-on-server-shutdown.patch rename to patches/server/Fix-plugin-loggers-on-server-shutdown.patch diff --git a/patches/unapplied/server/Fix-premature-player-kicks-on-shutdown.patch b/patches/server/Fix-premature-player-kicks-on-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-premature-player-kicks-on-shutdown.patch rename to patches/server/Fix-premature-player-kicks-on-shutdown.patch diff --git a/patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/server/Fixes-and-additions-to-the-SpawnReason-API.patch similarity index 100% rename from patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch rename to patches/server/Fixes-and-additions-to-the-SpawnReason-API.patch diff --git a/patches/unapplied/server/Friction-API.patch b/patches/server/Friction-API.patch similarity index 90% rename from patches/unapplied/server/Friction-API.patch rename to patches/server/Friction-API.patch index a332e0a235..dfc60b54f2 100644 --- a/patches/unapplied/server/Friction-API.patch +++ b/patches/server/Friction-API.patch @@ -68,22 +68,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 super(type, world); @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { this.move(MoverType.SELF, this.getDeltaMovement()); - float f1 = 0.98F; + float f = 0.98F; - if (this.onGround()) { + // Paper start - Friction API + if (frictionState == net.kyori.adventure.util.TriState.FALSE) { -+ f1 = 1F; ++ f = 1F; + } else if (this.onGround()) { + // Paper end - Friction API - f1 = this.level().getBlockState(this.getBlockPosBelowThatAffectsMyMovement()).getBlock().getFriction() * 0.98F; + f = this.level().getBlockState(this.getBlockPosBelowThatAffectsMyMovement()).getBlock().getFriction() * 0.98F; } -- this.setDeltaMovement(this.getDeltaMovement().multiply((double) f1, 0.98D, (double) f1)); -+ this.setDeltaMovement(this.getDeltaMovement().multiply((double) f1, frictionState == net.kyori.adventure.util.TriState.FALSE ? 1D : 0.98D, (double) f1)); // Paper - Friction API - if (this.onGround()) { - Vec3 vec3d1 = this.getDeltaMovement(); - @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { @Override @@ -97,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 nbt.putShort("Age", (short) this.age); nbt.putShort("PickupDelay", (short) this.pickupDelay); @@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity { - this.cachedThrower = null; + this.setItem(ItemStack.EMPTY); } + // Paper start - Friction API @@ -111,9 +106,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - Friction API + - CompoundTag nbttagcompound1 = nbt.getCompound("Item"); - - this.setItem(ItemStack.of(nbttagcompound1)); + if (this.getItem().isEmpty()) { + this.discard(null); // CraftBukkit - add Bukkit remove cause + } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java diff --git a/patches/unapplied/server/Ignore-impossible-spawn-tick.patch b/patches/server/Ignore-impossible-spawn-tick.patch similarity index 100% rename from patches/unapplied/server/Ignore-impossible-spawn-tick.patch rename to patches/server/Ignore-impossible-spawn-tick.patch diff --git a/patches/unapplied/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch b/patches/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch similarity index 95% rename from patches/unapplied/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch rename to patches/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch index 1a3e8aff67..fc405a61fd 100644 --- a/patches/unapplied/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch +++ b/patches/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch @@ -61,8 +61,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public static final int AMOUNT_FULL = 8; + protected final boolean isEmpty; // Paper - Perf: moved from isEmpty() - public FluidState(Fluid fluid, ImmutableMap, Comparable> propertiesMap, MapCodec codec) { - super(fluid, propertiesMap, codec); + public FluidState(Fluid fluid, Reference2ObjectArrayMap, Comparable> propertyMap, MapCodec codec) { + super(fluid, propertyMap, codec); + this.isEmpty = fluid.isEmpty(); // Paper - Perf: moved from isEmpty() } diff --git a/patches/unapplied/server/ItemStack-damage-API.patch b/patches/server/ItemStack-damage-API.patch similarity index 100% rename from patches/unapplied/server/ItemStack-damage-API.patch rename to patches/server/ItemStack-damage-API.patch diff --git a/patches/unapplied/server/Limit-pet-look-distance.patch b/patches/server/Limit-pet-look-distance.patch similarity index 100% rename from patches/unapplied/server/Limit-pet-look-distance.patch rename to patches/server/Limit-pet-look-distance.patch diff --git a/patches/unapplied/server/Missing-eating-regain-reason.patch b/patches/server/Missing-eating-regain-reason.patch similarity index 77% rename from patches/unapplied/server/Missing-eating-regain-reason.patch rename to patches/server/Missing-eating-regain-reason.patch index 21c2e6d51a..506f0b5753 100644 --- a/patches/unapplied/server/Missing-eating-regain-reason.patch +++ b/patches/server/Missing-eating-regain-reason.patch @@ -8,15 +8,15 @@ diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -0,0 +0,0 @@ public class Cat extends TamableAnimal implements VariantHolder { - if (!(item instanceof DyeItem)) { - if (item.isEdible() && this.isFood(itemstack) && this.getHealth() < this.getMaxHealth()) { - this.usePlayerItem(player, hand, itemstack); -- this.heal((float) item.getFoodProperties().getNutrition()); -+ this.heal((float) item.getFoodProperties().getNutrition(), org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason - return InteractionResult.CONSUME; - } +@@ -0,0 +0,0 @@ public class Cat extends TamableAnimal implements VariantHolder user.addEffect(effect.createEffectInstance())); -+ listPotionEffects(itemStack, effect -> user.addEffect(effect.createEffectInstance(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD)); // Paper - Add missing effect cause - return user instanceof Player && ((Player)user).getAbilities().instabuild ? itemStack : new ItemStack(Items.BOWL); - } - } + SuspiciousStewEffects suspiciousStewEffects = stack.getOrDefault(DataComponents.SUSPICIOUS_STEW_EFFECTS, SuspiciousStewEffects.EMPTY); + + for (SuspiciousStewEffects.Entry entry : suspiciousStewEffects.effects()) { +- user.addEffect(entry.createEffectInstance()); ++ user.addEffect(entry.createEffectInstance(), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // Paper - Add missing effect cause + } + + super.finishUsingItem(stack, world, user); diff --git a/patches/unapplied/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch similarity index 94% rename from patches/unapplied/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch rename to patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch index 221ed665c9..f8ec34d96d 100644 --- a/patches/unapplied/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch +++ b/patches/server/Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch @@ -11,7 +11,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -0,0 +0,0 @@ public class Commodore { - super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false); + super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE_PREFIX + "advancement/CraftAdvancement", "getDisplay0", desc, false); return; } + if (owner.equals("org/bukkit/WorldCreator") && name.equals("keepSpawnLoaded") && desc.equals("(Lnet/kyori/adventure/util/TriState;)V")) { diff --git a/patches/unapplied/server/More-vanilla-friendly-methods-to-update-trades.patch b/patches/server/More-vanilla-friendly-methods-to-update-trades.patch similarity index 100% rename from patches/unapplied/server/More-vanilla-friendly-methods-to-update-trades.patch rename to patches/server/More-vanilla-friendly-methods-to-update-trades.patch diff --git a/patches/unapplied/server/Player-Entity-Tracking-Events.patch b/patches/server/Player-Entity-Tracking-Events.patch similarity index 96% rename from patches/unapplied/server/Player-Entity-Tracking-Events.patch rename to patches/server/Player-Entity-Tracking-Events.patch index 51d138aaab..b6f2d7eaf7 100644 --- a/patches/unapplied/server/Player-Entity-Tracking-Events.patch +++ b/patches/server/Player-Entity-Tracking-Events.patch @@ -24,7 +24,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -0,0 +0,0 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void startSeenByPlayer(ServerPlayer player) {} diff --git a/patches/unapplied/server/Remove-unnecessary-onTrackingStart-during-navigation.patch b/patches/server/Remove-unnecessary-onTrackingStart-during-navigation.patch similarity index 89% rename from patches/unapplied/server/Remove-unnecessary-onTrackingStart-during-navigation.patch rename to patches/server/Remove-unnecessary-onTrackingStart-during-navigation.patch index d3f8b68c78..54a4fba01c 100644 --- a/patches/unapplied/server/Remove-unnecessary-onTrackingStart-during-navigation.patch +++ b/patches/server/Remove-unnecessary-onTrackingStart-during-navigation.patch @@ -9,18 +9,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - if (entity instanceof Mob) { - Mob entityinsentient = (Mob) entity; + } + if (entity instanceof Mob entityinsentient) { - if (ServerLevel.this.isUpdatingNavigations) { + if (false && ServerLevel.this.isUpdatingNavigations) { // Paper - Remove unnecessary onTrackingStart during navigation warning String s = "onTrackingStart called during navigation iteration"; Util.logAndPauseIfInIde("onTrackingStart called during navigation iteration", new IllegalStateException("onTrackingStart called during navigation iteration")); @@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel { - if (entity instanceof Mob) { - Mob entityinsentient = (Mob) entity; + } + if (entity instanceof Mob entityinsentient) { - if (ServerLevel.this.isUpdatingNavigations) { + if (false && ServerLevel.this.isUpdatingNavigations) { // Paper - Remove unnecessary onTrackingStart during navigation warning String s = "onTrackingStart called during navigation iteration"; diff --git a/patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch b/patches/server/Stop-large-look-changes-from-crashing-the-server.patch similarity index 100% rename from patches/unapplied/server/Stop-large-look-changes-from-crashing-the-server.patch rename to patches/server/Stop-large-look-changes-from-crashing-the-server.patch diff --git a/patches/unapplied/server/Sync-offhand-slot-in-menus.patch b/patches/server/Sync-offhand-slot-in-menus.patch similarity index 100% rename from patches/unapplied/server/Sync-offhand-slot-in-menus.patch rename to patches/server/Sync-offhand-slot-in-menus.patch diff --git a/patches/unapplied/server/check-global-player-list-where-appropriate.patch b/patches/server/check-global-player-list-where-appropriate.patch similarity index 99% rename from patches/unapplied/server/check-global-player-list-where-appropriate.patch rename to patches/server/check-global-player-list-where-appropriate.patch index f9a412126d..0aaaf846bf 100644 --- a/patches/unapplied/server/check-global-player-list-where-appropriate.patch +++ b/patches/server/check-global-player-list-where-appropriate.patch @@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java @@ -0,0 +0,0 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { - entityvillager.finalizeSpawn(world, world.getCurrentDifficultyAt(entityvillager.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) null); + entityvillager.finalizeSpawn(world, world.getCurrentDifficultyAt(entityvillager.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null); entityvillager.refreshBrain(world); if (this.conversionStarter != null) { - Player entityhuman = world.getPlayerByUUID(this.conversionStarter); diff --git a/patches/unapplied/server/ensure-reset-EnderDragon-boss-event-name.patch b/patches/server/ensure-reset-EnderDragon-boss-event-name.patch similarity index 100% rename from patches/unapplied/server/ensure-reset-EnderDragon-boss-event-name.patch rename to patches/server/ensure-reset-EnderDragon-boss-event-name.patch diff --git a/patches/unapplied/server/fix-Instruments.patch b/patches/server/fix-Instruments.patch similarity index 100% rename from patches/unapplied/server/fix-Instruments.patch rename to patches/server/fix-Instruments.patch diff --git a/patches/unapplied/server/fix-Jigsaw-block-kicking-user.patch b/patches/server/fix-Jigsaw-block-kicking-user.patch similarity index 100% rename from patches/unapplied/server/fix-Jigsaw-block-kicking-user.patch rename to patches/server/fix-Jigsaw-block-kicking-user.patch diff --git a/patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch b/patches/server/fix-MC-252817-green-map-markers-do-not-disappear.patch similarity index 53% rename from patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch rename to patches/server/fix-MC-252817-green-map-markers-do-not-disappear.patch index ee9bcee47f..4e1beefb21 100644 --- a/patches/unapplied/server/fix-MC-252817-green-map-markers-do-not-disappear.patch +++ b/patches/server/fix-MC-252817-green-map-markers-do-not-disappear.patch @@ -10,26 +10,30 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ItemFrame.java @@ -0,0 +0,0 @@ public class ItemFrame extends HangingEntity { - // Paper end + } - private void removeFramedMap(ItemStack itemstack) { -- this.getFramedMapId().ifPresent((i) -> { -+ // Paper start - fix MC-252817 (green map markers do not disappear) -+ this.getFramedMapIdFromItem(itemstack).ifPresent((i) -> { -+ // Paper end - fix MC-252817 - MapItemSavedData worldmap = MapItem.getSavedData(i, this.level()); + private void removeFramedMap(ItemStack stack) { +- MapId mapid = this.getFramedMapId(); +- ++ MapId mapid = this.getFramedMapIdForItem(stack); // Paper - fix MC-252817 (green map markers do not disappear) + if (mapid != null) { + MapItemSavedData worldmap = MapItem.getSavedData(mapid, this.level()); - if (worldmap != null) { @@ -0,0 +0,0 @@ public class ItemFrame extends HangingEntity { - public OptionalInt getFramedMapId() { - ItemStack itemstack = this.getItem(); -+ // Paper start - fix MC-252817 (green map markers do not disappear) -+ return this.getFramedMapIdFromItem(itemstack); + @Nullable + public MapId getFramedMapId() { +- return (MapId) this.getItem().get(DataComponents.MAP_ID); ++ // Paper start ++ return this.getFramedMapIdForItem(this.getItem()); + } + ++ @Nullable ++ public MapId getFramedMapIdForItem(ItemStack item) { ++ return (MapId) item.get(DataComponents.MAP_ID); + } - -+ public OptionalInt getFramedMapIdFromItem(ItemStack itemstack) { -+ // Paper end - fix MC-252817 - if (itemstack.is(Items.FILLED_MAP)) { - Integer integer = MapItem.getMapId(itemstack); - ++ // Paper end ++ + public boolean hasFramedMap() { + return this.getItem().has(DataComponents.MAP_ID); + } diff --git a/patches/unapplied/server/fix-entity-vehicle-collision-event-not-called.patch b/patches/server/fix-entity-vehicle-collision-event-not-called.patch similarity index 100% rename from patches/unapplied/server/fix-entity-vehicle-collision-event-not-called.patch rename to patches/server/fix-entity-vehicle-collision-event-not-called.patch diff --git a/patches/unapplied/server/use-BlockFormEvent-for-mud-converting-into-clay.patch b/patches/server/use-BlockFormEvent-for-mud-converting-into-clay.patch similarity index 91% rename from patches/unapplied/server/use-BlockFormEvent-for-mud-converting-into-clay.patch rename to patches/server/use-BlockFormEvent-for-mud-converting-into-clay.patch index 20cef258a7..8a30458c9e 100644 --- a/patches/unapplied/server/use-BlockFormEvent-for-mud-converting-into-clay.patch +++ b/patches/server/use-BlockFormEvent-for-mud-converting-into-clay.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - Call BlockFormEvent + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, iblockdata1)) { Block.pushEntitiesUp(((PointedDripstoneBlock.FluidInfo) optional.get()).sourceState, iblockdata1, world, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos); - world.gameEvent(GameEvent.BLOCK_CHANGE, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, GameEvent.Context.of(iblockdata1)); + world.gameEvent((Holder) GameEvent.BLOCK_CHANGE, ((PointedDripstoneBlock.FluidInfo) optional.get()).pos, GameEvent.Context.of(iblockdata1)); world.levelEvent(1504, blockposition1, 0); + } + // Paper end - Call BlockFormEvent diff --git a/patches/unapplied/server/Track-projectile-source-for-fireworks-from-dispenser.patch b/removed-patches-1-20-5/0815-Track-projectile-source-for-fireworks-from-dispenser.patch similarity index 100% rename from patches/unapplied/server/Track-projectile-source-for-fireworks-from-dispenser.patch rename to removed-patches-1-20-5/0815-Track-projectile-source-for-fireworks-from-dispenser.patch