From c07518e0c636784be22e605f7d6807e31597144e Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Tue, 14 Mar 2023 22:29:14 +0100 Subject: [PATCH] Applied all patches --- ...ntrol-player-s-insomnia-and-phantoms.patch | 2 +- .../server/Add-BlockLockCheckEvent.patch | 6 +- ...ItemEvent-and-EntityCompostItemEvent.patch | 52 +++----- .../server/Add-Entity-Body-Yaw-API.patch | 0 .../server/Add-EntityFertilizeEggEvent.patch | 0 .../Add-Sneaking-API-for-Entities.patch | 0 ...tion-for-spider-worldborder-climbing.patch | 0 ...ssing-SpigotConfig-logCommands-check.patch | 0 .../Add-missing-isFuel-Material-entries.patch | 0 ...ectly-handle-ArmorStand-invisibility.patch | 0 ...nk-items-during-EntityResurrectEvent.patch | 2 +- ...sion-moving-velocity-to-VehicleBlock.patch | 0 ...ity-drop-not-updating-the-client-inv.patch | 0 ...event-sleeping-villagers-moving-towa.patch | 0 ...x-MapLike-Codec-missing-key-selector.patch | 0 ...-Allay-stopDancing-while-not-dancing.patch | 0 .../Fix-chunk-snapshot-biome-getter.patch | 0 ...Fix-force-opening-enchantment-tables.patch | 0 ...ies-in-dispense-events-regarding-sta.patch | 20 +-- .../server/Fix-player-kick-on-shutdown.patch | 0 ...and-additions-to-the-SpawnReason-API.patch | 2 +- .../server/Flying-Fall-Damage.patch | 2 +- .../server/Improve-PortalEvents.patch | 0 ...-for-some-hot-BlockBehavior-and-Flui.patch | 0 .../server/Improve-logging-and-errors.patch | 0 .../server/Limit-pet-look-distance.patch | 2 +- .../Player-Entity-Tracking-Events.patch | 0 .../server/Properly-resend-entities.patch | 4 +- ...tItemStack-setAmount-null-assignment.patch | 0 .../server/Sync-offhand-slot-in-menus.patch | 0 ...when-a-captured-block-state-is-outda.patch | 0 ...le-player-info-update-packet-on-join.patch | 19 ++- .../server/Win-Screen-API.patch | 0 ...config-for-disabling-entity-tag-tags.patch | 0 .../server/fix-Instruments.patch | 0 ...ded-block-state-to-BlockExplodeEvent.patch | 125 ------------------ ...x-explosion-yield-with-new-gamerules.patch | 26 ---- 37 files changed, 56 insertions(+), 206 deletions(-) rename patches/{unapplied => }/server/Ability-to-control-player-s-insomnia-and-phantoms.patch (99%) rename patches/{unapplied => }/server/Add-BlockLockCheckEvent.patch (92%) rename patches/{unapplied => }/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch (61%) rename patches/{unapplied => }/server/Add-Entity-Body-Yaw-API.patch (100%) rename patches/{unapplied => }/server/Add-EntityFertilizeEggEvent.patch (100%) rename patches/{unapplied => }/server/Add-Sneaking-API-for-Entities.patch (100%) rename patches/{unapplied => }/server/Add-config-option-for-spider-worldborder-climbing.patch (100%) rename patches/{unapplied => }/server/Add-missing-SpigotConfig-logCommands-check.patch (100%) rename patches/{unapplied => }/server/Add-missing-isFuel-Material-entries.patch (100%) rename patches/{unapplied => }/server/Correctly-handle-ArmorStand-invisibility.patch (100%) rename patches/{unapplied => }/server/Correctly-shrink-items-during-EntityResurrectEvent.patch (98%) rename patches/{unapplied => }/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch (100%) rename patches/{unapplied => }/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch (100%) rename patches/{unapplied => }/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch (100%) rename patches/{unapplied => }/server/Fix-MapLike-Codec-missing-key-selector.patch (100%) rename patches/{unapplied => }/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch (100%) rename patches/{unapplied => }/server/Fix-chunk-snapshot-biome-getter.patch (100%) rename patches/{unapplied => }/server/Fix-force-opening-enchantment-tables.patch (100%) rename patches/{unapplied => }/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch (97%) rename patches/{unapplied => }/server/Fix-player-kick-on-shutdown.patch (100%) rename patches/{unapplied => }/server/Fixes-and-additions-to-the-SpawnReason-API.patch (99%) rename patches/{unapplied => }/server/Flying-Fall-Damage.patch (98%) rename patches/{unapplied => }/server/Improve-PortalEvents.patch (100%) rename patches/{unapplied => }/server/Improve-inlining-for-some-hot-BlockBehavior-and-Flui.patch (100%) rename patches/{unapplied => }/server/Improve-logging-and-errors.patch (100%) rename patches/{unapplied => }/server/Limit-pet-look-distance.patch (93%) rename patches/{unapplied => }/server/Player-Entity-Tracking-Events.patch (100%) rename patches/{unapplied => }/server/Properly-resend-entities.patch (97%) rename patches/{unapplied => }/server/Remove-CraftItemStack-setAmount-null-assignment.patch (100%) rename patches/{unapplied => }/server/Sync-offhand-slot-in-menus.patch (100%) rename patches/{unapplied => }/server/Update-the-flag-when-a-captured-block-state-is-outda.patch (100%) rename patches/{unapplied => }/server/Use-single-player-info-update-packet-on-join.patch (81%) rename patches/{unapplied => }/server/Win-Screen-API.patch (100%) rename patches/{unapplied => }/server/config-for-disabling-entity-tag-tags.patch (100%) rename patches/{unapplied => }/server/fix-Instruments.patch (100%) delete mode 100644 patches/unapplied/server/Add-exploded-block-state-to-BlockExplodeEvent.patch delete mode 100644 patches/unapplied/server/Fix-explosion-yield-with-new-gamerules.patch 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 99% 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 index 82229fb927..af0b179c39 100644 --- 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 @@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return 0; } else { @@ -0,0 +0,0 @@ public class PhantomSpawner implements CustomSpawner { - int j = Mth.clamp(serverstatisticmanager.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), (int) 1, Integer.MAX_VALUE); + int j = Mth.clamp(serverstatisticmanager.getValue(Stats.CUSTOM.get(Stats.TIME_SINCE_REST)), 1, Integer.MAX_VALUE); boolean flag2 = true; - if (randomsource.nextInt(j) >= 72000) { diff --git a/patches/unapplied/server/Add-BlockLockCheckEvent.patch b/patches/server/Add-BlockLockCheckEvent.patch similarity index 92% rename from patches/unapplied/server/Add-BlockLockCheckEvent.patch rename to patches/server/Add-BlockLockCheckEvent.patch index 9f4d5cc29d..00a95b4e6b 100644 --- a/patches/unapplied/server/Add-BlockLockCheckEvent.patch +++ b/patches/server/Add-BlockLockCheckEvent.patch @@ -62,9 +62,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name @Nullable @Override - public AbstractContainerMenu createMenu(int syncId, Inventory inv, Player player) { -- return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName()) ? new BeaconMenu(syncId, inv, this.dataAccess, ContainerLevelAccess.create(this.level, this.getBlockPos())) : null; -+ return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName(), this) ? new BeaconMenu(syncId, inv, this.dataAccess, ContainerLevelAccess.create(this.level, this.getBlockPos())) : null; // Paper + public AbstractContainerMenu createMenu(int syncId, Inventory playerInventory, Player player) { +- return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName()) ? new BeaconMenu(syncId, playerInventory, this.dataAccess, ContainerLevelAccess.create(this.level, this.getBlockPos())) : null; ++ return BaseContainerBlockEntity.canUnlock(player, this.lockKey, this.getDisplayName(), this) ? new BeaconMenu(syncId, playerInventory, this.dataAccess, ContainerLevelAccess.create(this.level, this.getBlockPos())) : null; } @Override diff --git a/patches/unapplied/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch b/patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch similarity index 61% rename from patches/unapplied/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch rename to patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch index f62f7f0e74..a8c4a7675a 100644 --- a/patches/unapplied/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch +++ b/patches/server/Add-CompostItemEvent-and-EntityCompostItemEvent.patch @@ -4,6 +4,19 @@ Date: Sun, 8 Aug 2021 19:56:02 +0200 Subject: [PATCH] Add CompostItemEvent and EntityCompostItemEvent +diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java ++++ b/src/main/java/net/minecraft/world/entity/ai/behavior/WorkAtComposter.java +@@ -0,0 +0,0 @@ public class WorkAtComposter extends WorkAtPoi { + i -= p; + + for(int q = 0; q < p; ++q) { +- blockState = ComposterBlock.insertItem(entity, blockState, world, itemStack, blockPos); ++ blockState = ComposterBlock.insertItem(entity, blockState, world, itemStack, blockPos, entity); // Paper + if (blockState.getValue(ComposterBlock.LEVEL) == 7) { + this.spawnComposterFillEffects(world, composterState, blockPos, blockState); + return; 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java @@ -12,8 +25,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (state != dummyBlockState && org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, pos, dummyBlockState).isCancelled()) { // if block state will change and event cancelled return InteractionResult.sidedSuccess(world.isClientSide); } -- BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, rand); -+ BlockState iblockdata1 = ComposterBlock.addItem(state, world, pos, itemstack, player); +- BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, itemstack, rand); ++ BlockState iblockdata1 = ComposterBlock.addItem(player, state, world, pos, itemstack); + if (iblockdata1 == null) { + return InteractionResult.PASS; + } @@ -21,43 +34,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 world.levelEvent(1500, pos, state != iblockdata1 ? 1 : 0); @@ -0,0 +0,0 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { - if (i < 7 && ComposterBlock.COMPOSTABLES.containsKey(itemstack.getItem())) { - // CraftBukkit start - double rand = worldserver.getRandom().nextDouble(); -- BlockState iblockdata1 = ComposterBlock.addItem(iblockdata, DummyGeneratorAccess.INSTANCE, blockposition, itemstack, rand); -+ BlockState iblockdata1 = ComposterBlock.addItem(iblockdata, DummyGeneratorAccess.INSTANCE, blockposition, itemstack, rand, entity); // Paper - if (iblockdata == iblockdata1 || org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entity, blockposition, iblockdata1).isCancelled()) { - return iblockdata; + return state; } -- iblockdata1 = ComposterBlock.addItem(iblockdata, (LevelAccessor) worldserver, blockposition, itemstack, rand); + iblockdata1 = ComposterBlock.addItem(user, state, world, pos, stack, rand); + // Paper start -+ iblockdata1 = ComposterBlock.addItem(iblockdata, (LevelAccessor) worldserver, blockposition, itemstack, rand, entity); + if (iblockdata1 == null) { -+ return iblockdata; ++ return state; + } + // Paper end // CraftBukkit end - itemstack.shrink(1); + stack.shrink(1); @@ -0,0 +0,0 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { - // CraftBukkit start - return ComposterBlock.addItem(state, world, pos, item, world.getRandom().nextDouble()); - } -+ // Paper start -+ static BlockState addItem(BlockState state, LevelAccessor world, BlockPos pos, ItemStack item, @Nullable Entity entity) { -+ return ComposterBlock.addItem(state, world, pos, item, world.getRandom().nextDouble(), entity); -+ } -+ // Paper end - - static BlockState addItem(BlockState iblockdata, LevelAccessor generatoraccess, BlockPos blockposition, ItemStack itemstack, double rand) { -+ // Paper start -+ return ComposterBlock.addItem(iblockdata, generatoraccess, blockposition, itemstack, rand, null); -+ } -+ -+ @Nullable -+ static BlockState addItem(BlockState iblockdata, LevelAccessor generatoraccess, BlockPos blockposition, ItemStack itemstack, double rand, @Nullable Entity entity) { -+ // Paper end - // CraftBukkit end int i = (Integer) iblockdata.getValue(ComposterBlock.LEVEL); float f = ComposterBlock.COMPOSTABLES.getFloat(itemstack.getItem()); @@ -82,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 int j = i + 1; @@ -0,0 +0,0 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder { this.changed = true; - BlockState iblockdata = ComposterBlock.addItem(this.state, this.level, this.pos, itemstack); + BlockState iblockdata = ComposterBlock.addItem((Entity) null, this.state, this.level, this.pos, itemstack); + // Paper start + if (iblockdata == null) { diff --git a/patches/unapplied/server/Add-Entity-Body-Yaw-API.patch b/patches/server/Add-Entity-Body-Yaw-API.patch similarity index 100% rename from patches/unapplied/server/Add-Entity-Body-Yaw-API.patch rename to patches/server/Add-Entity-Body-Yaw-API.patch diff --git a/patches/unapplied/server/Add-EntityFertilizeEggEvent.patch b/patches/server/Add-EntityFertilizeEggEvent.patch similarity index 100% rename from patches/unapplied/server/Add-EntityFertilizeEggEvent.patch rename to patches/server/Add-EntityFertilizeEggEvent.patch diff --git a/patches/unapplied/server/Add-Sneaking-API-for-Entities.patch b/patches/server/Add-Sneaking-API-for-Entities.patch similarity index 100% rename from patches/unapplied/server/Add-Sneaking-API-for-Entities.patch rename to patches/server/Add-Sneaking-API-for-Entities.patch diff --git a/patches/unapplied/server/Add-config-option-for-spider-worldborder-climbing.patch b/patches/server/Add-config-option-for-spider-worldborder-climbing.patch similarity index 100% rename from patches/unapplied/server/Add-config-option-for-spider-worldborder-climbing.patch rename to patches/server/Add-config-option-for-spider-worldborder-climbing.patch diff --git a/patches/unapplied/server/Add-missing-SpigotConfig-logCommands-check.patch b/patches/server/Add-missing-SpigotConfig-logCommands-check.patch similarity index 100% rename from patches/unapplied/server/Add-missing-SpigotConfig-logCommands-check.patch rename to patches/server/Add-missing-SpigotConfig-logCommands-check.patch diff --git a/patches/unapplied/server/Add-missing-isFuel-Material-entries.patch b/patches/server/Add-missing-isFuel-Material-entries.patch similarity index 100% rename from patches/unapplied/server/Add-missing-isFuel-Material-entries.patch rename to patches/server/Add-missing-isFuel-Material-entries.patch diff --git a/patches/unapplied/server/Correctly-handle-ArmorStand-invisibility.patch b/patches/server/Correctly-handle-ArmorStand-invisibility.patch similarity index 100% rename from patches/unapplied/server/Correctly-handle-ArmorStand-invisibility.patch rename to patches/server/Correctly-handle-ArmorStand-invisibility.patch diff --git a/patches/unapplied/server/Correctly-shrink-items-during-EntityResurrectEvent.patch b/patches/server/Correctly-shrink-items-during-EntityResurrectEvent.patch similarity index 98% rename from patches/unapplied/server/Correctly-shrink-items-during-EntityResurrectEvent.patch rename to patches/server/Correctly-shrink-items-during-EntityResurrectEvent.patch index 6c810bb67e..ab8849c5de 100644 --- a/patches/unapplied/server/Correctly-shrink-items-during-EntityResurrectEvent.patch +++ b/patches/server/Correctly-shrink-items-during-EntityResurrectEvent.patch @@ -25,7 +25,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/ma index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity { +@@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { this.level.getCraftServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/patches/unapplied/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch similarity index 100% rename from patches/unapplied/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch rename to patches/server/Expose-pre-collision-moving-velocity-to-VehicleBlock.patch diff --git a/patches/unapplied/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch b/patches/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch similarity index 100% rename from patches/unapplied/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch rename to patches/server/Fix-HumanEntity-drop-not-updating-the-client-inv.patch diff --git a/patches/unapplied/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch b/patches/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch similarity index 100% rename from patches/unapplied/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch rename to patches/server/Fix-MC-157464-Prevent-sleeping-villagers-moving-towa.patch diff --git a/patches/unapplied/server/Fix-MapLike-Codec-missing-key-selector.patch b/patches/server/Fix-MapLike-Codec-missing-key-selector.patch similarity index 100% rename from patches/unapplied/server/Fix-MapLike-Codec-missing-key-selector.patch rename to patches/server/Fix-MapLike-Codec-missing-key-selector.patch diff --git a/patches/unapplied/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch b/patches/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch similarity index 100% rename from patches/unapplied/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch rename to patches/server/Fix-NPE-on-Allay-stopDancing-while-not-dancing.patch diff --git a/patches/unapplied/server/Fix-chunk-snapshot-biome-getter.patch b/patches/server/Fix-chunk-snapshot-biome-getter.patch similarity index 100% rename from patches/unapplied/server/Fix-chunk-snapshot-biome-getter.patch rename to patches/server/Fix-chunk-snapshot-biome-getter.patch diff --git a/patches/unapplied/server/Fix-force-opening-enchantment-tables.patch b/patches/server/Fix-force-opening-enchantment-tables.patch similarity index 100% rename from patches/unapplied/server/Fix-force-opening-enchantment-tables.patch rename to patches/server/Fix-force-opening-enchantment-tables.patch diff --git a/patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch b/patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch similarity index 97% rename from patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch rename to patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch index 8b5e4a2ce6..7b7e32b54c 100644 --- a/patches/unapplied/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch +++ b/patches/server/Fix-inconsistencies-in-dispense-events-regarding-sta.patch @@ -149,14 +149,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); @@ -0,0 +0,0 @@ public interface DispenseItemBehavior { - EntityType.updateCustomEntityTag(worldserver, (Player) null, entityarmorstand, stack.getTag()); - entityarmorstand.setYRot(enumdirection.toYRot()); - worldserver.addFreshEntity(entityarmorstand); -- // itemstack.shrink(1); // CraftBukkit - Handled during event processing -+ if (shrink) stack.shrink(1); // Paper - actually handle here + ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, stack.getTag(), consumer, blockposition, MobSpawnType.DISPENSER, false, false); + + if (entityarmorstand != null) { +- // itemstack.shrink(1); // CraftBukkit - Handled during event processing ++ if (shrink) stack.shrink(1); // Paper - actually handle here + } + return stack; - } - }); @@ -0,0 +0,0 @@ public interface DispenseItemBehavior { if (!list.isEmpty()) { @@ -451,7 +451,7 @@ diff --git a/src/main/java/net/minecraft/world/item/ArmorItem.java b/src/main/ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/item/ArmorItem.java +++ b/src/main/java/net/minecraft/world/item/ArmorItem.java -@@ -0,0 +0,0 @@ public class ArmorItem extends Item implements Wearable { +@@ -0,0 +0,0 @@ public class ArmorItem extends Item implements Equipable { } else { LivingEntity entityliving = (LivingEntity) list.get(0); EquipmentSlot enumitemslot = Mob.getEquipmentSlotForItem(armor); @@ -460,7 +460,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit start Level world = pointer.getLevel(); org.bukkit.block.Block block = world.getWorld().getBlockAt(pointer.getPos().getX(), pointer.getPos().getY(), pointer.getPos().getZ()); -@@ -0,0 +0,0 @@ public class ArmorItem extends Item implements Wearable { +@@ -0,0 +0,0 @@ public class ArmorItem extends Item implements Equipable { } if (event.isCancelled()) { @@ -476,7 +476,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Chain to handler for new item ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem()); DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem()); -@@ -0,0 +0,0 @@ public class ArmorItem extends Item implements Wearable { +@@ -0,0 +0,0 @@ public class ArmorItem extends Item implements Equipable { ((Mob) entityliving).setPersistenceRequired(); } diff --git a/patches/unapplied/server/Fix-player-kick-on-shutdown.patch b/patches/server/Fix-player-kick-on-shutdown.patch similarity index 100% rename from patches/unapplied/server/Fix-player-kick-on-shutdown.patch rename to patches/server/Fix-player-kick-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 99% 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 index 37e009d347..145b555dc4 100644 --- a/patches/unapplied/server/Fixes-and-additions-to-the-SpawnReason-API.patch +++ b/patches/server/Fixes-and-additions-to-the-SpawnReason-API.patch @@ -37,7 +37,7 @@ diff --git a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.ja index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java -@@ -0,0 +0,0 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements We +@@ -0,0 +0,0 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements Eq // clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - moved down entity.moveTo((double) pos.getX() + 0.5D, (double) pos.getY() + 0.05D, (double) pos.getZ() + 0.5D, 0.0F, 0.0F); // CraftBukkit start diff --git a/patches/unapplied/server/Flying-Fall-Damage.patch b/patches/server/Flying-Fall-Damage.patch similarity index 98% rename from patches/unapplied/server/Flying-Fall-Damage.patch rename to patches/server/Flying-Fall-Damage.patch index d86499cf3f..63725e4ec4 100644 --- a/patches/unapplied/server/Flying-Fall-Damage.patch +++ b/patches/server/Flying-Fall-Damage.patch @@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java @@ -0,0 +0,0 @@ public abstract class Player extends LivingEntity { - public FishingHook fishing; + protected float hurtDir; // Paper start public boolean affectsSpawning = true; + public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; diff --git a/patches/unapplied/server/Improve-PortalEvents.patch b/patches/server/Improve-PortalEvents.patch similarity index 100% rename from patches/unapplied/server/Improve-PortalEvents.patch rename to patches/server/Improve-PortalEvents.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 100% 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 diff --git a/patches/unapplied/server/Improve-logging-and-errors.patch b/patches/server/Improve-logging-and-errors.patch similarity index 100% rename from patches/unapplied/server/Improve-logging-and-errors.patch rename to patches/server/Improve-logging-and-errors.patch diff --git a/patches/unapplied/server/Limit-pet-look-distance.patch b/patches/server/Limit-pet-look-distance.patch similarity index 93% rename from patches/unapplied/server/Limit-pet-look-distance.patch rename to patches/server/Limit-pet-look-distance.patch index 60d9a7c23c..c683948380 100644 --- a/patches/unapplied/server/Limit-pet-look-distance.patch +++ b/patches/server/Limit-pet-look-distance.patch @@ -16,4 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + if (this.tamable.distanceToSqr(this.owner) <= 16 * 16) this.tamable.getLookControl().setLookAt(this.owner, 10.0F, (float) this.tamable.getMaxHeadXRot()); // Paper if (--this.timeToRecalcPath <= 0) { this.timeToRecalcPath = this.adjustedTickDelay(10); - if (!this.tamable.isLeashed() && !this.tamable.isPassenger()) { + if (this.tamable.distanceToSqr((Entity) this.owner) >= 144.0D) { diff --git a/patches/unapplied/server/Player-Entity-Tracking-Events.patch b/patches/server/Player-Entity-Tracking-Events.patch similarity index 100% rename from patches/unapplied/server/Player-Entity-Tracking-Events.patch rename to patches/server/Player-Entity-Tracking-Events.patch diff --git a/patches/unapplied/server/Properly-resend-entities.patch b/patches/server/Properly-resend-entities.patch similarity index 97% rename from patches/unapplied/server/Properly-resend-entities.patch rename to patches/server/Properly-resend-entities.patch index fe1739ae5a..359fb77557 100644 --- a/patches/unapplied/server/Properly-resend-entities.patch +++ b/patches/server/Properly-resend-entities.patch @@ -89,8 +89,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - player.getEntityData().refresh(player); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn + //player.getEntityData().refresh(player); // CraftBukkit - BungeeCord#2321, send complete data to self on spawn Paper - THIS IS NOT NEEDED ANYMORE - // CraftBukkit start - Only add if the player wasn't moved in the event - if (player.level == worldserver1 && !worldserver1.players().contains(player)) { + this.sendLevelInfo(player, worldserver1); + diff --git a/src/main/java/net/minecraft/world/entity/animal/Bucketable.java b/src/main/java/net/minecraft/world/entity/animal/Bucketable.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bucketable.java diff --git a/patches/unapplied/server/Remove-CraftItemStack-setAmount-null-assignment.patch b/patches/server/Remove-CraftItemStack-setAmount-null-assignment.patch similarity index 100% rename from patches/unapplied/server/Remove-CraftItemStack-setAmount-null-assignment.patch rename to patches/server/Remove-CraftItemStack-setAmount-null-assignment.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/Update-the-flag-when-a-captured-block-state-is-outda.patch b/patches/server/Update-the-flag-when-a-captured-block-state-is-outda.patch similarity index 100% rename from patches/unapplied/server/Update-the-flag-when-a-captured-block-state-is-outda.patch rename to patches/server/Update-the-flag-when-a-captured-block-state-is-outda.patch diff --git a/patches/unapplied/server/Use-single-player-info-update-packet-on-join.patch b/patches/server/Use-single-player-info-update-packet-on-join.patch similarity index 81% rename from patches/unapplied/server/Use-single-player-info-update-packet-on-join.patch rename to patches/server/Use-single-player-info-update-packet-on-join.patch index ec26bd3865..67451cc3a5 100644 --- a/patches/unapplied/server/Use-single-player-info-update-packet-on-join.patch +++ b/patches/server/Use-single-player-info-update-packet-on-join.patch @@ -22,11 +22,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { + player.sendServerStatus(serverping); + } - playerconnection.teleport(player.getX(), player.getY(), player.getZ(), player.getYRot(), player.getXRot()); - player.sendServerStatus(this.server.getStatus()); - player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); -+ // player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // Paper - use single player info update packet ++ // player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // Paper this.players.add(player); this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot this.playersByUUID.put(player.getUUID(), player); @@ -58,3 +58,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 player.sentListPacket = true; player.supressTrackerForLogin = false; // Paper ((ServerLevel)player.level).getChunkSource().chunkMap.addEntity(player); // Paper - track entity now +diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java ++++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java +@@ -0,0 +0,0 @@ public class DamageSources { + public DamageSource sonicBoom(Entity attacker) { + return this.source(DamageTypes.SONIC_BOOM, attacker); + } +- +- public DamageSource badRespawnPointExplosion(Vec3 position) { +- return new DamageSource(this.damageTypes.getHolderOrThrow(DamageTypes.BAD_RESPAWN_POINT), position); +- } + } diff --git a/patches/unapplied/server/Win-Screen-API.patch b/patches/server/Win-Screen-API.patch similarity index 100% rename from patches/unapplied/server/Win-Screen-API.patch rename to patches/server/Win-Screen-API.patch diff --git a/patches/unapplied/server/config-for-disabling-entity-tag-tags.patch b/patches/server/config-for-disabling-entity-tag-tags.patch similarity index 100% rename from patches/unapplied/server/config-for-disabling-entity-tag-tags.patch rename to patches/server/config-for-disabling-entity-tag-tags.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/Add-exploded-block-state-to-BlockExplodeEvent.patch b/patches/unapplied/server/Add-exploded-block-state-to-BlockExplodeEvent.patch deleted file mode 100644 index fc59b48027..0000000000 --- a/patches/unapplied/server/Add-exploded-block-state-to-BlockExplodeEvent.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Fri, 22 Oct 2021 16:25:07 -0700 -Subject: [PATCH] Add exploded block state to BlockExplodeEvent - - -diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java -+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -@@ -0,0 +0,0 @@ public class DamageSource { - return this; - } - // Paper end -+ public @Nullable org.bukkit.block.BlockState explodedBlockState; // Paper - add exploded state - - public static DamageSource fallingBlock(Entity attacker) { - return (new EntityDamageSource("fallingBlock", attacker)).damageHelmet(); -@@ -0,0 +0,0 @@ public class DamageSource { - return (new EntityDamageSource("sonic_boom", attacker)).bypassArmor().bypassEnchantments().setMagic(); - } - -+ @Deprecated @io.papermc.paper.annotation.DoNotUse // Paper - public static DamageSource badRespawnPointExplosion(Vec3 pos) { -- return new BadRespawnPointDamage(pos); -+ // Paper start -+ return badRespawnPointExplosion(pos, null); -+ } -+ public static DamageSource badRespawnPointExplosion(Vec3 pos, @Nullable org.bukkit.block.BlockState explodedBlockState) { -+ DamageSource source = new BadRespawnPointDamage(pos); -+ source.explodedBlockState = explodedBlockState; -+ return source; -+ // Paper end - } - - public String toString() { -diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/Explosion.java -+++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -0,0 +0,0 @@ public class Explosion { - bukkitBlocks = event.blockList(); - yield = event.getYield(); - } else { -- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F); // Paper - fix explosion yield with new gamerules -+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, this.damageSource.explodedBlockState); // Paper - fix explosion yield with new gamerules & exploded block state - this.level.getCraftServer().getPluginManager().callEvent(event); - cancelled = event.isCancelled(); - bukkitBlocks = event.blockList(); -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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/BedBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/BedBlock.java -@@ -0,0 +0,0 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - - // CraftBukkit - moved world and biome check into EntityHuman - if (false && !BedBlock.canSetSpawn(world)) { -+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, pos, state); // Paper - exploded block state (this won't be called due to the false, but it's good for reference) - world.removeBlock(pos, false); - BlockPos blockposition1 = pos.relative(((Direction) state.getValue(BedBlock.FACING)).getOpposite()); - -@@ -0,0 +0,0 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - - Vec3 vec3d = pos.getCenter(); - -- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); -+ world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state - return InteractionResult.SUCCESS; - } else if ((Boolean) state.getValue(BedBlock.OCCUPIED)) { - if (!this.kickVillagerOutOfBed(world, pos)) { -@@ -0,0 +0,0 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - private InteractionResult explodeBed(BlockState iblockdata, Level world, BlockPos blockposition) { - { - { -+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getUnplacedBlockState(world, blockposition, iblockdata); // Paper - exploded block state - world.removeBlock(blockposition, false); - BlockPos blockposition1 = blockposition.relative(((Direction) iblockdata.getValue(BedBlock.FACING)).getOpposite()); - -@@ -0,0 +0,0 @@ public class BedBlock extends HorizontalDirectionalBlock implements EntityBlock - - Vec3 vec3d = blockposition.getCenter(); - -- world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); -+ world.explode((Entity) null, DamageSource.badRespawnPointExplosion(vec3d, explodedBlockState), (ExplosionDamageCalculator) null, vec3d, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state - return InteractionResult.SUCCESS; - } - } -diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java -@@ -0,0 +0,0 @@ public class RespawnAnchorBlock extends Block { - } - - private void explode(BlockState state, Level world, final BlockPos explodedPos) { -+ final org.bukkit.block.BlockState explodedBlockState = org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(explodedPos, state, null); // Paper - exploded block state - world.removeBlock(explodedPos, false); - boolean bl = Direction.Plane.HORIZONTAL.stream().map(explodedPos::relative).anyMatch((pos) -> { - return isWaterThatWouldFlow(pos, world); -@@ -0,0 +0,0 @@ public class RespawnAnchorBlock extends Block { - } - }; - Vec3 vec3 = explodedPos.getCenter(); -- world.explode((Entity)null, DamageSource.badRespawnPointExplosion(vec3), explosionDamageCalculator, vec3, 5.0F, true, Level.ExplosionInteraction.BLOCK); -+ world.explode((Entity)null, DamageSource.badRespawnPointExplosion(vec3, explodedBlockState), explosionDamageCalculator, vec3, 5.0F, true, Level.ExplosionInteraction.BLOCK); // Paper - exploded block state - } - - public static boolean canSetSpawn(Level world) { -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -@@ -0,0 +0,0 @@ public final class CraftBlockStates { - BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag); - return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity); - } -+ // Paper start -+ public static BlockState getUnplacedBlockState(net.minecraft.world.level.BlockGetter levelAccessor, BlockPos blockPos, net.minecraft.world.level.block.state.BlockState blockData) { -+ BlockEntity tileEntity = levelAccessor.getBlockEntity(blockPos); -+ return CraftBlockStates.getBlockState(null, blockPos, blockData, tileEntity); -+ } -+ // Paper end - - // See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity) - private static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { diff --git a/patches/unapplied/server/Fix-explosion-yield-with-new-gamerules.patch b/patches/unapplied/server/Fix-explosion-yield-with-new-gamerules.patch deleted file mode 100644 index c5ac209743..0000000000 --- a/patches/unapplied/server/Fix-explosion-yield-with-new-gamerules.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic -Date: Wed, 14 Dec 2022 17:46:27 -0800 -Subject: [PATCH] Fix explosion yield with new gamerules - - -diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/Explosion.java -+++ b/src/main/java/net/minecraft/world/level/Explosion.java -@@ -0,0 +0,0 @@ public class Explosion { - float yield; - - if (explode != null) { -- EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY ? 1.0F / this.radius : 1.0F); -+ EntityExplodeEvent event = new EntityExplodeEvent(explode, location, blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F); // Paper - fix explosion yield with new gamerules - this.level.getCraftServer().getPluginManager().callEvent(event); - cancelled = event.isCancelled(); - bukkitBlocks = event.blockList(); - yield = event.getYield(); - } else { -- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY ? 1.0F / this.radius : 1.0F); -+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F); // Paper - fix explosion yield with new gamerules - this.level.getCraftServer().getPluginManager().callEvent(event); - cancelled = event.isCancelled(); - bukkitBlocks = event.blockList();