diff --git a/patches/unapplied/server/0119-Configurable-Cartographer-Treasure-Maps.patch b/patches/server/0118-Configurable-Cartographer-Treasure-Maps.patch similarity index 95% rename from patches/unapplied/server/0119-Configurable-Cartographer-Treasure-Maps.patch rename to patches/server/0118-Configurable-Cartographer-Treasure-Maps.patch index 52b259bda3..a93dd268ae 100644 --- a/patches/unapplied/server/0119-Configurable-Cartographer-Treasure-Maps.patch +++ b/patches/server/0118-Configurable-Cartographer-Treasure-Maps.patch @@ -9,10 +9,10 @@ Also allow turning off treasure maps all together as they can eat up Map ID's which are limited in quantity. diff --git a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java -index 672301d47037f96f32c52fa400ed28694f3b138b..96240f8ed0675ebfd403fcef144657885c4bb9a9 100644 +index 9358498491cd25ef760527ebd83188b76f8458f1..73a222d91dab1d5d1390b018f9537624aaff0798 100644 --- a/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java +++ b/src/main/java/net/minecraft/world/entity/npc/VillagerTrades.java -@@ -1667,7 +1667,8 @@ public class VillagerTrades { +@@ -1828,7 +1828,8 @@ public class VillagerTrades { return null; } else { ServerLevel serverLevel = (ServerLevel)entity.level(); diff --git a/patches/unapplied/server/0120-Add-API-methods-to-control-if-armor-stands-can-move.patch b/patches/server/0119-Add-API-methods-to-control-if-armor-stands-can-move.patch similarity index 90% rename from patches/unapplied/server/0120-Add-API-methods-to-control-if-armor-stands-can-move.patch rename to patches/server/0119-Add-API-methods-to-control-if-armor-stands-can-move.patch index e164186ab4..ace73cb969 100644 --- a/patches/unapplied/server/0120-Add-API-methods-to-control-if-armor-stands-can-move.patch +++ b/patches/server/0119-Add-API-methods-to-control-if-armor-stands-can-move.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add API methods to control if armor stands can move diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -index c443fef645702e2a3eae8dcd1526d4bc4d269b0f..dd7ecba4525d90e6b9509d1c3cab24c1615e37a9 100644 +index af954b2c0c7106a231fb15172da3fa8e1d281d56..dae6835696e90bc5a541cacd37ea7aa88c60f4f4 100644 --- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java +++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java -@@ -96,6 +96,7 @@ public class ArmorStand extends LivingEntity { +@@ -95,6 +95,7 @@ public class ArmorStand extends LivingEntity { public Rotations rightArmPose; public Rotations leftLegPose; public Rotations rightLegPose; @@ -16,7 +16,7 @@ index c443fef645702e2a3eae8dcd1526d4bc4d269b0f..dd7ecba4525d90e6b9509d1c3cab24c1 public ArmorStand(EntityType type, Level world) { super(type, world); -@@ -942,4 +943,13 @@ public class ArmorStand extends LivingEntity { +@@ -949,4 +950,13 @@ public class ArmorStand extends LivingEntity { public boolean canBeSeenByAnyone() { return !this.isInvisible() && !this.isMarker(); } diff --git a/patches/unapplied/server/0121-String-based-Action-Bar-API.patch b/patches/server/0120-String-based-Action-Bar-API.patch similarity index 91% rename from patches/unapplied/server/0121-String-based-Action-Bar-API.patch rename to patches/server/0120-String-based-Action-Bar-API.patch index f6d7d353e6..5da74157bd 100644 --- a/patches/unapplied/server/0121-String-based-Action-Bar-API.patch +++ b/patches/server/0120-String-based-Action-Bar-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] String based Action Bar API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 93e537aa401bc17f2a34da4f0119026ee34e2c1f..8a6ce3d9eda1aa14577c4441d3f3d76fb6750f69 100644 +index b6c5636f21bfbade1dc9d048579e513f43642eb6..591dac203a4b93630fd4b1a95f44aaa364571cd8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -386,6 +386,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -388,6 +388,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } // Paper start diff --git a/patches/unapplied/server/0122-Properly-fix-item-duplication-bug.patch b/patches/server/0121-Properly-fix-item-duplication-bug.patch similarity index 80% rename from patches/unapplied/server/0122-Properly-fix-item-duplication-bug.patch rename to patches/server/0121-Properly-fix-item-duplication-bug.patch index 5462debbf6..42be9e08a5 100644 --- a/patches/unapplied/server/0122-Properly-fix-item-duplication-bug.patch +++ b/patches/server/0121-Properly-fix-item-duplication-bug.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index eb04f9ae48d1122cd08ccdd2798131dd124221df..96bc2fa87502c363c68822d512e3c63c09a29513 100644 +index 916ba7c09b077bc3c9ed9fad579e607e4c065e06..813c3bc9943e2700d2e4ad2335b7d235d21610fa 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -2559,7 +2559,7 @@ public class ServerPlayer extends Player { +@@ -2624,7 +2624,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { @Override public boolean isImmobile() { @@ -19,10 +19,10 @@ index eb04f9ae48d1122cd08ccdd2798131dd124221df..96bc2fa87502c363c68822d512e3c63c @Override diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 5f5d8ae29ff702eacc72341fae074a05d977e7cd..fc2fd0842e25fbe5c46ae07200c4b1a5950ae29a 100644 +index d2061ea6f670edd33be2460eef0b489e88857690..e8d1ade5542dcf01476ba8580cc281b28f36c9a0 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -178,7 +178,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -179,7 +179,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack } public final boolean isDisconnected() { diff --git a/patches/unapplied/server/0123-Firework-API-s.patch b/patches/server/0122-Firework-API-s.patch similarity index 91% rename from patches/unapplied/server/0123-Firework-API-s.patch rename to patches/server/0122-Firework-API-s.patch index 5253f63b53..c86538a2cf 100644 --- a/patches/unapplied/server/0123-Firework-API-s.patch +++ b/patches/server/0122-Firework-API-s.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Firework API's public net.minecraft.world.entity.projectile.FireworkRocketEntity attachedToEntity diff --git a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -index f525fafc638c7252c99b6d98cf579be11ca5463e..6671796d292fbc922a94271136f5a7a4bbdedaca 100644 +index cc99d67bc52c89b50171b6c808c6e3bf293999f5..09d465947a5720e05c350d455c86002682104079 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FireworkRocketEntity.java -@@ -42,6 +42,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { +@@ -44,6 +44,7 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { public int lifetime; @Nullable public LivingEntity attachedToEntity; @@ -18,7 +18,7 @@ index f525fafc638c7252c99b6d98cf579be11ca5463e..6671796d292fbc922a94271136f5a7a4 public FireworkRocketEntity(EntityType type, Level world) { super(type, world); -@@ -299,6 +300,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { +@@ -301,6 +302,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { nbt.putInt("LifeTime", this.lifetime); nbt.put("FireworksItem", this.getItem().save(this.registryAccess())); nbt.putBoolean("ShotAtAngle", (Boolean) this.entityData.get(FireworkRocketEntity.DATA_SHOT_AT_ANGLE)); @@ -30,7 +30,7 @@ index f525fafc638c7252c99b6d98cf579be11ca5463e..6671796d292fbc922a94271136f5a7a4 } @Override -@@ -315,7 +321,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { +@@ -317,7 +323,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier { if (nbt.contains("ShotAtAngle")) { this.entityData.set(FireworkRocketEntity.DATA_SHOT_AT_ANGLE, nbt.getBoolean("ShotAtAngle")); } @@ -44,10 +44,10 @@ index f525fafc638c7252c99b6d98cf579be11ca5463e..6671796d292fbc922a94271136f5a7a4 private List getExplosions() { diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java -index c797fc980577d77e18cd5ea660e4c42ca0f21747..65f23bfb2de91be7560800ff87eab7ad88cb1849 100644 +index 99a39f05e7aeefa2ea4372159b4837d80963eabf..f64cdfac1fc1333845ea4ea5efb7922f0ae39619 100644 --- a/src/main/java/net/minecraft/world/item/CrossbowItem.java +++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java -@@ -147,7 +147,11 @@ public class CrossbowItem extends ProjectileWeaponItem { +@@ -160,7 +160,11 @@ public class CrossbowItem extends ProjectileWeaponItem { @Override protected Projectile createProjectile(Level world, LivingEntity shooter, ItemStack weaponStack, ItemStack projectileStack, boolean critical) { if (projectileStack.is(Items.FIREWORK_ROCKET)) { diff --git a/patches/server/0123-PlayerTeleportEndGatewayEvent.patch b/patches/server/0123-PlayerTeleportEndGatewayEvent.patch new file mode 100644 index 0000000000..7943af1159 --- /dev/null +++ b/patches/server/0123-PlayerTeleportEndGatewayEvent.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 31 Dec 2016 21:44:50 -0500 +Subject: [PATCH] PlayerTeleportEndGatewayEvent + +Allows you to access the Gateway being used in a teleport event +Fix the offset used for player teleportation + +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index 813c3bc9943e2700d2e4ad2335b7d235d21610fa..a2d35f7066d89f861c1b75ec8a62f03ed6f65dd8 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -1195,11 +1195,22 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { + ResourceKey resourcekey = worldserver1.getTypeKey(); + + if (worldserver != null && worldserver.dimension() == worldserver1.dimension()) { // CraftBukkit ++ // Paper start - gateway-specific teleport event ++ if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.serverLevel().getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { ++ Location to = CraftLocation.toBukkit(teleportTarget.pos(), this.serverLevel().getWorld(), teleportTarget.yRot(), teleportTarget.xRot()); ++ final com.destroystokyo.paper.event.player.PlayerTeleportEndGatewayEvent event = new com.destroystokyo.paper.event.player.PlayerTeleportEndGatewayEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), to, new org.bukkit.craftbukkit.block.CraftEndGateway(to.getWorld(), theEndGatewayBlockEntity)); ++ if (!event.callEvent() || event.getTo() == null) { ++ return null; ++ } ++ this.connection.teleport(event.getTo()); ++ } else { ++ // Paper end - gateway-specific teleport event + boolean result = this.connection.teleport(teleportTarget.pos().x, teleportTarget.pos().y, teleportTarget.pos().z, teleportTarget.yRot(), teleportTarget.xRot(), teleportTarget.cause()); + if (!result) { + return null; + } + // CraftBukkit end ++ } // Paper + this.connection.resetPosition(); + teleportTarget.postDimensionTransition().onTransition(this); + return this; diff --git a/patches/unapplied/server/0125-Provide-E-TE-Chunk-count-stat-methods.patch b/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch similarity index 92% rename from patches/unapplied/server/0125-Provide-E-TE-Chunk-count-stat-methods.patch rename to patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch index 22eeb318ab..afc98a061a 100644 --- a/patches/unapplied/server/0125-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/patches/server/0124-Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 004dd17181a49df5c2255a9eeca03f5a354920aa..ec6640bc761b6232d6b48a32fae11e60d5cdcbdf 100644 +index 03b0720c6ebf1a876d56d18a941e0a06ed26dbf0..4fcbea7b8b12be10157da0c1f35c06e47c0334ad 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -113,7 +113,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -114,7 +114,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public static final int TICKS_PER_DAY = 24000; public static final int MAX_ENTITY_SPAWN_Y = 20000000; public static final int MIN_ENTITY_SPAWN_Y = -20000000; @@ -20,7 +20,7 @@ index 004dd17181a49df5c2255a9eeca03f5a354920aa..ec6640bc761b6232d6b48a32fae11e60 private final List pendingBlockEntityTickers = Lists.newArrayList(); private boolean tickingBlockEntities; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index ee5b61c476abc1f9a2babf350ac9dfa45b2c3253..8fea8bc0117b5b9ebff1979a73783446b7afe228 100644 +index 1e8d93d81b7a391bbd1e9926ff35a68d4c563f0f..2794a7996147fce5533877a47cd1e7b6f7e7576f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -164,6 +164,56 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/unapplied/server/0126-Enforce-Sync-Player-Saves.patch b/patches/server/0125-Enforce-Sync-Player-Saves.patch similarity index 87% rename from patches/unapplied/server/0126-Enforce-Sync-Player-Saves.patch rename to patches/server/0125-Enforce-Sync-Player-Saves.patch index 0a5c3c945c..b867d70b81 100644 --- a/patches/unapplied/server/0126-Enforce-Sync-Player-Saves.patch +++ b/patches/server/0125-Enforce-Sync-Player-Saves.patch @@ -7,10 +7,10 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 3fb300026e627313c65ea23b9c0a9f57a97fa310..2753b821f17ea8950a80c5d0e96d7b367d00e068 100644 +index aaae646588a3a09c96a4bc481f15a44a96efbb8e..9d46c2241098959e30a2e45762a67386eeec6d5d 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -1060,11 +1060,13 @@ public abstract class PlayerList { +@@ -1029,11 +1029,13 @@ public abstract class PlayerList { } public void saveAll() { diff --git a/patches/unapplied/server/0127-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch similarity index 88% rename from patches/unapplied/server/0127-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch rename to patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 4be7a3850e..b0df3a6a52 100644 --- a/patches/unapplied/server/0127-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -8,10 +8,10 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 344d22ae4067bccd6d42b444f6b057c9d1ea6e82..f4bf927477af23365a2d4618a1634195bd2054c8 100644 +index 99771070840a545537fe352bda1c4aaeedd638ca..2fab84c5e2dc4de39281956390588a9a71d02f68 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -430,7 +430,7 @@ public class ServerPlayerGameMode { +@@ -435,7 +435,7 @@ public class ServerPlayerGameMode { // Drop event experience if (flag && event != null) { @@ -21,10 +21,10 @@ index 344d22ae4067bccd6d42b444f6b057c9d1ea6e82..f4bf927477af23365a2d4618a1634195 return true; diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index b919ae8602f54f6ec8c9c743f3e852cd4c00e97f..0dd931a082a972cd62f80f32ef0c7177b0daf599 100644 +index 25a45e680f9fdea90f43d59de87a3a500f4ee8c0..0330a62a6a0060d2a96de191db68774588fc7ae5 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -41,9 +41,63 @@ public class ExperienceOrb extends Entity { +@@ -44,9 +44,63 @@ public class ExperienceOrb extends Entity { public int value; public int count; private Player followingPlayer; @@ -88,7 +88,7 @@ index b919ae8602f54f6ec8c9c743f3e852cd4c00e97f..0dd931a082a972cd62f80f32ef0c7177 this.setPos(x, y, z); this.setYRot((float) (this.random.nextDouble() * 360.0D)); this.setDeltaMovement((this.random.nextDouble() * 0.20000000298023224D - 0.10000000149011612D) * 2.0D, this.random.nextDouble() * 0.2D * 2.0D, (this.random.nextDouble() * 0.20000000298023224D - 0.10000000149011612D) * 2.0D); -@@ -167,12 +221,20 @@ public class ExperienceOrb extends Entity { +@@ -170,12 +224,20 @@ public class ExperienceOrb extends Entity { } public static void award(ServerLevel world, Vec3 pos, int amount) { @@ -110,7 +110,7 @@ index b919ae8602f54f6ec8c9c743f3e852cd4c00e97f..0dd931a082a972cd62f80f32ef0c7177 } } -@@ -242,6 +304,7 @@ public class ExperienceOrb extends Entity { +@@ -245,6 +307,7 @@ public class ExperienceOrb extends Entity { nbt.putShort("Age", (short) this.age); nbt.putShort("Value", (short) this.value); nbt.putInt("Count", this.count); @@ -118,7 +118,7 @@ index b919ae8602f54f6ec8c9c743f3e852cd4c00e97f..0dd931a082a972cd62f80f32ef0c7177 } @Override -@@ -250,6 +313,7 @@ public class ExperienceOrb extends Entity { +@@ -253,6 +316,7 @@ public class ExperienceOrb extends Entity { this.age = nbt.getShort("Age"); this.value = nbt.getShort("Value"); this.count = Math.max(nbt.getInt("Count"), 1); @@ -127,21 +127,20 @@ index b919ae8602f54f6ec8c9c743f3e852cd4c00e97f..0dd931a082a972cd62f80f32ef0c7177 @Override diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 51f6b7be6b8e65dbd8700ba2d7a40760b229f512..3cb452003cffd02a1ef88b0cb512a5c66d4e078b 100644 +index 258e99365fd3c51c60b8adba46645f04111d96c2..65f75b10460563c1305d97fa5337f035ba915e4b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1813,7 +1813,8 @@ public abstract class LivingEntity extends Entity implements Attackable { - protected void dropExperience() { +@@ -1788,7 +1788,7 @@ public abstract class LivingEntity extends Entity implements Attackable { + protected void dropExperience(@Nullable Entity attacker) { // CraftBukkit start - Update getExpReward() above if the removed if() changes! - if (true && !(this instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time + if (!(this instanceof net.minecraft.world.entity.boss.enderdragon.EnderDragon)) { // CraftBukkit - SPIGOT-2420: Special case ender dragon will drop the xp over time - ExperienceOrb.award((ServerLevel) this.level(), this.position(), this.expToDrop); -+ LivingEntity attacker = this.lastHurtByPlayer != null ? this.lastHurtByPlayer : this.lastHurtByMob; // Paper + ExperienceOrb.award((ServerLevel) this.level(), this.position(), this.expToDrop, this instanceof ServerPlayer ? org.bukkit.entity.ExperienceOrb.SpawnReason.PLAYER_DEATH : org.bukkit.entity.ExperienceOrb.SpawnReason.ENTITY_DEATH, attacker, this); // Paper this.expToDrop = 0; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java -index ec112d626a189aafb148455d097919e88af7ef28..3bd13c9b8c7573726ae7defdc3c0f32876d1cf1f 100644 +index 1af60680c512e0743920440215247d191f9a8385..370c444153d04fe7896952219604d83a19a996e2 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Animal.java +++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java @@ -250,12 +250,14 @@ public abstract class Animal extends AgeableMob { @@ -173,7 +172,7 @@ index ec112d626a189aafb148455d097919e88af7ef28..3bd13c9b8c7573726ae7defdc3c0f328 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/world/entity/animal/Fox.java b/src/main/java/net/minecraft/world/entity/animal/Fox.java -index 40ea9af580f841c3aba61db7c34efb88d542a547..d2dfccd1e31b2f050c9f480220cf17df71c687c3 100644 +index de2a25db9465bc4ae3cbf7ff6d3af756df679f4a..a6788da1505f9e119c03b94488f5e006da13e918 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Fox.java +++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java @@ -897,7 +897,7 @@ public class Fox extends Animal implements VariantHolder { @@ -186,7 +185,7 @@ index 40ea9af580f841c3aba61db7c34efb88d542a547..d2dfccd1e31b2f050c9f480220cf17df // CraftBukkit end } 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 e401efe0c15bbc6236259645447791142ea2fbda..cf565f3a4baf5898000d23eeedcf314b0c10db5a 100644 +index d4659ce017692c6f8cabb56137a231bc566614b0..6f90ee749aed98b97868aa40fc233d164ddc2ef6 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java @@ -455,7 +455,7 @@ public class Turtle extends Animal { @@ -199,10 +198,10 @@ index e401efe0c15bbc6236259645447791142ea2fbda..cf565f3a4baf5898000d23eeedcf314b } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 993ccde9e6ee769ce51cdfa4ff06cfe1bd27bbb0..963fdb4132001aa781eda45b75cb4df97d782ddc 100644 +index dba973ba5088d253aa67f5577663cccda7f4edd1..5e83ca6fa874227b5d63148502405bb77f5345ba 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -@@ -672,7 +672,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -689,7 +689,7 @@ public class EnderDragon extends Mob implements Enemy { if (this.level() instanceof ServerLevel) { if (this.dragonDeathTime > 150 && this.dragonDeathTime % 5 == 0 && true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp @@ -211,7 +210,7 @@ index 993ccde9e6ee769ce51cdfa4ff06cfe1bd27bbb0..963fdb4132001aa781eda45b75cb4df9 } if (this.dragonDeathTime == 1 && !this.isSilent()) { -@@ -701,7 +701,7 @@ public class EnderDragon extends Mob implements Enemy { +@@ -718,7 +718,7 @@ public class EnderDragon extends Mob implements Enemy { this.move(MoverType.SELF, new Vec3(0.0D, 0.10000000149011612D, 0.0D)); if (this.dragonDeathTime == 200 && this.level() instanceof ServerLevel) { if (true) { // CraftBukkit - SPIGOT-2420: Already checked for the game rule when calculating the xp @@ -221,10 +220,10 @@ index 993ccde9e6ee769ce51cdfa4ff06cfe1bd27bbb0..963fdb4132001aa781eda45b75cb4df9 if (this.dragonFight != null) { diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 0da329781f0afd4ec4a731889b892afe7e399d21..d1c3f5d076a3d560d02553d6a33e5890d0c2bfc7 100644 +index 243eb1e54293c763a06febff551c051398d43535..79fdc8284f57a4f11e1954936ad574f7b8df5435 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -632,7 +632,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -634,7 +634,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } if (offer.shouldRewardExp()) { @@ -234,7 +233,7 @@ index 0da329781f0afd4ec4a731889b892afe7e399d21..d1c3f5d076a3d560d02553d6a33e5890 } diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -index c493c324a2606a40a3a04a55cb77790614d2707b..057eca881d279c610e933ebff5fb654625b036be 100644 +index 0f2e2e42e732e942664d70a72dd9c4e47c7e95b6..e51cb9c96e1bd13c00bf938436f4fc26d80055a1 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java @@ -207,7 +207,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill @@ -247,10 +246,10 @@ index c493c324a2606a40a3a04a55cb77790614d2707b..057eca881d279c610e933ebff5fb6546 } diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -index 1eeb61688cae52bb25ef6d9ac4f0a0df3d34f846..c3a035742271611f2d26cf4af0d5877369dd6558 100644 +index ed43ad94ca007a54e3c32d5e17c141048eeb5835..0b4c67b9de6893601f032a8fae103e8a98f2c767 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java +++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java -@@ -524,7 +524,7 @@ public class FishingHook extends Projectile { +@@ -525,7 +525,7 @@ public class FishingHook extends Projectile { this.level().addFreshEntity(entityitem); // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() if (playerFishEvent.getExpToDrop() > 0) { @@ -273,10 +272,10 @@ index 9963db38420b91ae817a18ff084311cb45c0edee..70ceef96c6305324aef3b006f6603817 } diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 4e3c70f7cff0235dd58414e258567ef07661f53f..d41197db6bbf9e17b67bb1faa5d370eea0212bd3 100644 +index 1c0a9ca0ccfd89dd26736012ce1c329dffb7f913..637d77d6b07ff9ee5ac1cb0470cbefcba5c7495e 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -@@ -97,7 +97,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { +@@ -98,7 +98,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { public void onTake(net.minecraft.world.entity.player.Player player, ItemStack stack) { context.execute((world, blockposition) -> { if (world instanceof ServerLevel) { @@ -286,10 +285,10 @@ index 4e3c70f7cff0235dd58414e258567ef07661f53f..d41197db6bbf9e17b67bb1faa5d370ee world.levelEvent(1042, blockposition, 0); diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java -index 946001c57c326f2d2f0677bca954e8558f1c851b..ed336112581ac77196ed3e60dc8aaf50312c078b 100644 +index def3e28edc206e0ba41111e26332db468223fb2e..6d0a90e9c637edff5c5ce1355a3b45f0fb7f4154 100644 --- a/src/main/java/net/minecraft/world/level/block/Block.java +++ b/src/main/java/net/minecraft/world/level/block/Block.java -@@ -361,8 +361,13 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -360,8 +360,13 @@ public class Block extends BlockBehaviour implements ItemLike { } public void popExperience(ServerLevel world, BlockPos pos, int size) { @@ -305,10 +304,10 @@ index 946001c57c326f2d2f0677bca954e8558f1c851b..ed336112581ac77196ed3e60dc8aaf50 } 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 8bda1a42907132b1f3289f860530ded0a4e61f93..70e068c3d0f72f31df749add2c57450f793524ae 100644 +index c0dea02bb38dffb5003293c2d91e28e998da0a9c..e2a587ca5b732c62c4956e6f39ad795cd1411cc4 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 -@@ -630,7 +630,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -633,7 +633,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit j = event.getExpToDrop(); // CraftBukkit end @@ -318,10 +317,10 @@ index 8bda1a42907132b1f3289f860530ded0a4e61f93..70e068c3d0f72f31df749add2c57450f @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -index 52d4eaf7c92b9b4252e0cae25128b5ae7b0092cc..3bbd314d94de3736e039b4b2d836afa8cc892511 100644 +index 5b7bdf06ae6df1eeccb5a8da143745235f58e07e..9b2b0bbb1755b6be1c23cf56e29a68b0002fd755 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java -@@ -371,7 +371,7 @@ public final class CraftEntityTypes { +@@ -372,7 +372,7 @@ public final class CraftEntityTypes { return item; })); register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, diff --git a/patches/unapplied/server/0128-Cap-Entity-Collisions.patch b/patches/server/0127-Cap-Entity-Collisions.patch similarity index 86% rename from patches/unapplied/server/0128-Cap-Entity-Collisions.patch rename to patches/server/0127-Cap-Entity-Collisions.patch index fc5bd3f9ff..3b6b618ab0 100644 --- a/patches/unapplied/server/0128-Cap-Entity-Collisions.patch +++ b/patches/server/0127-Cap-Entity-Collisions.patch @@ -12,10 +12,10 @@ just as it does in Vanilla, but entity pushing logic will be capped. You can set this to 0 to disable collisions. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2fcdd61e9669904756aa33b1ff8ab7160ea5e371..660a210c363fcb42145b273ea6b977ce4844505d 100644 +index ea25e9ab6c1d54e834a05951d2369d6e2e3a3fb3..78cb145f72efaaf535b6f933b3ca990a3f909608 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -395,6 +395,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -401,6 +401,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public long activatedTick = Integer.MIN_VALUE; public void inactiveTick() { } // Spigot end @@ -24,10 +24,10 @@ index 2fcdd61e9669904756aa33b1ff8ab7160ea5e371..660a210c363fcb42145b273ea6b977ce @javax.annotation.Nullable private org.bukkit.util.Vector origin; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3cb452003cffd02a1ef88b0cb512a5c66d4e078b..eafbe6fd829c2067b1e81ea8aad77fe3ba3df82f 100644 +index 65f75b10460563c1305d97fa5337f035ba915e4b..57ba53cf9f84b21185bbaefd482f9d6dea2cb772 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3454,10 +3454,12 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3474,10 +3474,12 @@ public abstract class LivingEntity extends Entity implements Attackable { } Iterator iterator1 = list.iterator(); diff --git a/patches/unapplied/server/0129-Remove-CraftScheduler-Async-Task-Debugger.patch b/patches/server/0128-Remove-CraftScheduler-Async-Task-Debugger.patch similarity index 100% rename from patches/unapplied/server/0129-Remove-CraftScheduler-Async-Task-Debugger.patch rename to patches/server/0128-Remove-CraftScheduler-Async-Task-Debugger.patch diff --git a/patches/unapplied/server/0130-Properly-handle-async-calls-to-restart-the-server.patch b/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch similarity index 93% rename from patches/unapplied/server/0130-Properly-handle-async-calls-to-restart-the-server.patch rename to patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch index d5a2f6ec3b..b9167e41f2 100644 --- a/patches/unapplied/server/0130-Properly-handle-async-calls-to-restart-the-server.patch +++ b/patches/server/0129-Properly-handle-async-calls-to-restart-the-server.patch @@ -30,10 +30,10 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fca7340f5b0dbbf072a752e7e7b589dbaeb17d50..1fdd088f0bb6606f2a9a482d276aa3e9261be012 100644 +index 56d51073eb0cd902fa2c1e790201f74d120b149f..7335f9bb936eeb585ee077b0b9c461d7946d6134 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -236,6 +236,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, ServerLevel> levels; private PlayerList playerList; private volatile boolean running; @@ -41,7 +41,7 @@ index fca7340f5b0dbbf072a752e7e7b589dbaeb17d50..1fdd088f0bb6606f2a9a482d276aa3e9 private boolean stopped; private int tickCount; private int ticksUntilAutosave; -@@ -931,7 +932,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop) MinecraftServer.getServer().getPlayerList().players ) - { -- p.connection.disconnect(SpigotConfig.restartMessage); +- p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) ); - } - // Give the socket a chance to send the packets - try @@ -138,7 +138,7 @@ index 1e251d0f6de25a0a8c739c5f18ec5b949d4fc396..051b9e3a5d29a5840d596468e3ddd013 + // Kick all players + for ( ServerPlayer p : com.google.common.collect.ImmutableList.copyOf( MinecraftServer.getServer().getPlayerList().players ) ) + { -+ p.connection.disconnect(SpigotConfig.restartMessage); ++ p.connection.disconnect( CraftChatMessage.fromStringOrEmpty( SpigotConfig.restartMessage ) ); + } + // Give the socket a chance to send the packets + try diff --git a/patches/unapplied/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch similarity index 88% rename from patches/unapplied/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch rename to patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 808589b545..08f175db14 100644 --- a/patches/unapplied/server/0131-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/patches/server/0130-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -14,10 +14,10 @@ To be converted into a Paper-API event at some point in the future? public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b4b775687ec47c0deeced7fbf1316e0766797d0d..df0cc552024c64c7e4f53386a75f8fee3008155b 100644 +index be42d98848e79eca79fed0ee42a1b25b50347226..934faa4f5f40f3b0b63bc8be970b92d5219d9aeb 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2242,6 +2242,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2259,6 +2259,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl switch (packet.getAction()) { case PRESS_SHIFT_KEY: this.player.setShiftKeyDown(true); @@ -32,10 +32,10 @@ index b4b775687ec47c0deeced7fbf1316e0766797d0d..df0cc552024c64c7e4f53386a75f8fee case RELEASE_SHIFT_KEY: this.player.setShiftKeyDown(false); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index a1c5e5913430404838205bc4a04b2afcff9d9046..0654cca68acefccec82cc138acba30515a336cfb 100644 +index 0d1d8ad353ff2f2bd478cfdc2f6bebad5203e190..c9423872c23f3334afad34e662041c5f5d1ad1a2 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -588,6 +588,7 @@ public abstract class Player extends LivingEntity { +@@ -592,6 +592,7 @@ public abstract class Player extends LivingEntity { this.playShoulderEntityAmbientSound(this.getShoulderEntityLeft()); this.playShoulderEntityAmbientSound(this.getShoulderEntityRight()); if (!this.level().isClientSide && (this.fallDistance > 0.5F || this.isInWater()) || this.abilities.flying || this.isSleeping() || this.isInPowderSnow) { diff --git a/patches/unapplied/server/0132-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch similarity index 83% rename from patches/unapplied/server/0132-Add-configuration-option-to-prevent-player-names-fro.patch rename to patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch index 29a5cc9244..205e5d6964 100644 --- a/patches/unapplied/server/0132-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 52dc0049d596287a089bd5397cdfd2c99c711f2a..e9aa21a1ca5a3406f8ab40e1ce75f9e0ab6ddf5a 100644 +index a387fa6ce162531497788e0bbcec3c5ffdfa4c68..859719521b07f061103a5e27a2c134849ecb9b08 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2822,5 +2822,10 @@ public final class CraftServer implements Server { +@@ -2830,5 +2830,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/patches/unapplied/server/0133-provide-a-configurable-option-to-disable-creeper-lin.patch b/patches/server/0132-provide-a-configurable-option-to-disable-creeper-lin.patch similarity index 86% rename from patches/unapplied/server/0133-provide-a-configurable-option-to-disable-creeper-lin.patch rename to patches/server/0132-provide-a-configurable-option-to-disable-creeper-lin.patch index 0ea235e63e..a9a07893c4 100644 --- a/patches/unapplied/server/0133-provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/patches/server/0132-provide-a-configurable-option-to-disable-creeper-lin.patch @@ -6,10 +6,10 @@ Subject: [PATCH] provide a configurable option to disable creeper lingering diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -index 204685bc15650c1b40067d4374e2e6bb53948eb6..b76b637ff940dde21647d1f34acd59a23159bb3c 100644 +index c7ca5af731e0b92a511b90cba2047b1ed7d4e144..92384c2da9a15a781794e16176349eb39d012696 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java +++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -@@ -286,7 +286,7 @@ public class Creeper extends Monster implements PowerableMob { +@@ -287,7 +287,7 @@ public class Creeper extends Monster implements PowerableMob { private void spawnLingeringCloud() { Collection collection = this.getActiveEffects(); diff --git a/patches/unapplied/server/0134-Item-canEntityPickup.patch b/patches/server/0133-Item-canEntityPickup.patch similarity index 87% rename from patches/unapplied/server/0134-Item-canEntityPickup.patch rename to patches/server/0133-Item-canEntityPickup.patch index a7a20fc9a0..1bb47aa9ca 100644 --- a/patches/unapplied/server/0134-Item-canEntityPickup.patch +++ b/patches/server/0133-Item-canEntityPickup.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index d4559aea807e3ee76f9dd1ecde72f77644636923..6b802f8f214e5cf2bac145e88bf8e39040cec7ea 100644 +index e81a25462239dbb3993f31ff927bd809aef0a124..25fd665f3b02edfcc9fc7092b93296a7c6e43338 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -715,6 +715,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti +@@ -675,6 +675,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab ItemEntity entityitem = (ItemEntity) iterator.next(); if (!entityitem.isRemoved() && !entityitem.getItem().isEmpty() && !entityitem.hasPickUpDelay() && this.wantsToPickUp(entityitem.getItem())) { @@ -21,10 +21,10 @@ index d4559aea807e3ee76f9dd1ecde72f77644636923..6b802f8f214e5cf2bac145e88bf8e390 } } diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index 16e3bdf6a2789a0828fc9d879b441fa4bd12d428..707fe72003a254a84ceef8a0572fff52997a4129 100644 +index c4cd7cf1567cdf57bfe9f2d80cd4a613efe10dc7..759c246540bbd5cb99c78a722c39b72fbc1951d4 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -59,6 +59,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -60,6 +60,7 @@ public class ItemEntity extends Entity implements TraceableEntity { public UUID target; public final float bobOffs; private int lastTick = MinecraftServer.currentTick - 1; // CraftBukkit diff --git a/patches/unapplied/server/0135-PlayerPickupItemEvent-setFlyAtPlayer.patch b/patches/server/0134-PlayerPickupItemEvent-setFlyAtPlayer.patch similarity index 87% rename from patches/unapplied/server/0135-PlayerPickupItemEvent-setFlyAtPlayer.patch rename to patches/server/0134-PlayerPickupItemEvent-setFlyAtPlayer.patch index 6a32c3b05f..282fdd4f1e 100644 --- a/patches/unapplied/server/0135-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/patches/server/0134-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index 707fe72003a254a84ceef8a0572fff52997a4129..f63d1145be7b6fb76373a4ec1423fd7cedf73b63 100644 +index 759c246540bbd5cb99c78a722c39b72fbc1951d4..f51f04758e135294bab5c7d1f891a8d67fea78f5 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -435,6 +435,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -436,6 +436,7 @@ public class ItemEntity extends Entity implements TraceableEntity { // CraftBukkit start - fire PlayerPickupItemEvent int canHold = player.getInventory().canHold(itemstack); int remaining = i - canHold; @@ -16,7 +16,7 @@ index 707fe72003a254a84ceef8a0572fff52997a4129..f63d1145be7b6fb76373a4ec1423fd7c if (this.pickupDelay <= 0 && canHold > 0) { itemstack.setCount(canHold); -@@ -442,8 +443,14 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -443,8 +444,14 @@ public class ItemEntity extends Entity implements TraceableEntity { PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((Player) player.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); playerEvent.setCancelled(!playerEvent.getPlayer().getCanPickupItems()); this.level().getCraftServer().getPluginManager().callEvent(playerEvent); @@ -31,7 +31,7 @@ index 707fe72003a254a84ceef8a0572fff52997a4129..f63d1145be7b6fb76373a4ec1423fd7c return; } -@@ -473,6 +480,7 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -474,6 +481,7 @@ public class ItemEntity extends Entity implements TraceableEntity { // CraftBukkit end if (this.pickupDelay == 0 && (this.target == null || this.target.equals(player.getUUID())) && player.getInventory().add(itemstack)) { diff --git a/patches/unapplied/server/0136-PlayerAttemptPickupItemEvent.patch b/patches/server/0135-PlayerAttemptPickupItemEvent.patch similarity index 88% rename from patches/unapplied/server/0136-PlayerAttemptPickupItemEvent.patch rename to patches/server/0135-PlayerAttemptPickupItemEvent.patch index af6c33cefe..50726dbd17 100644 --- a/patches/unapplied/server/0136-PlayerAttemptPickupItemEvent.patch +++ b/patches/server/0135-PlayerAttemptPickupItemEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -index f63d1145be7b6fb76373a4ec1423fd7cedf73b63..d97e12a2dca072ae102b029fb67472dacc2c5b40 100644 +index f51f04758e135294bab5c7d1f891a8d67fea78f5..f9dfd6e7b610cfee75524a525ab0e72bed5522da 100644 --- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java -@@ -39,6 +39,7 @@ import org.bukkit.event.entity.EntityPickupItemEvent; +@@ -40,6 +40,7 @@ import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.entity.EntityRemoveEvent; import org.bukkit.event.player.PlayerPickupItemEvent; // CraftBukkit end @@ -16,7 +16,7 @@ index f63d1145be7b6fb76373a4ec1423fd7cedf73b63..d97e12a2dca072ae102b029fb67472da public class ItemEntity extends Entity implements TraceableEntity { -@@ -437,6 +438,22 @@ public class ItemEntity extends Entity implements TraceableEntity { +@@ -438,6 +439,22 @@ public class ItemEntity extends Entity implements TraceableEntity { int remaining = i - canHold; boolean flyAtPlayer = false; // Paper diff --git a/patches/unapplied/server/0137-Do-not-submit-profile-lookups-to-worldgen-threads.patch b/patches/server/0136-Do-not-submit-profile-lookups-to-worldgen-threads.patch similarity index 93% rename from patches/unapplied/server/0137-Do-not-submit-profile-lookups-to-worldgen-threads.patch rename to patches/server/0136-Do-not-submit-profile-lookups-to-worldgen-threads.patch index 6482a635ec..57ef5ff7bb 100644 --- a/patches/unapplied/server/0137-Do-not-submit-profile-lookups-to-worldgen-threads.patch +++ b/patches/server/0136-Do-not-submit-profile-lookups-to-worldgen-threads.patch @@ -10,10 +10,10 @@ out due to a sync load, as the worldgen threads will be stalling on profile lookups. diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java -index 9d91e7890d8cba72f0aa2ca9661f6de7ae8a0dcd..cf54e2c8e8aadb9e7343382a5ba59c657234c9b9 100644 +index 396f368a7e21a7c7b1630b4e20cdbc452c4b0f84..54562fa04d14a937451ea7aa9d80194f2c31b471 100644 --- a/src/main/java/net/minecraft/Util.java +++ b/src/main/java/net/minecraft/Util.java -@@ -93,6 +93,22 @@ public class Util { +@@ -92,6 +92,22 @@ public class Util { private static final ExecutorService BACKGROUND_EXECUTOR = makeExecutor("Main"); private static final ExecutorService IO_POOL = makeIoExecutor("IO-Worker-", false); private static final ExecutorService DOWNLOAD_POOL = makeIoExecutor("Download-", true); @@ -35,7 +35,7 @@ index 9d91e7890d8cba72f0aa2ca9661f6de7ae8a0dcd..cf54e2c8e8aadb9e7343382a5ba59c65 + // Paper end - don't submit BLOCKING PROFILE LOOKUPS to the world gen thread private static final DateTimeFormatter FILENAME_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd_HH.mm.ss", Locale.ROOT); public static final int LINEAR_LOOKUP_THRESHOLD = 8; - public static final long NANOS_PER_MILLI = 1000000L; + private static final Set ALLOWED_UNTRUSTED_LINK_PROTOCOLS = Set.of("http", "https"); diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java index aeb0c7ce9b6f93dadd407dbdefba053568f2e2fe..416b26c2ab62b29d640169166980e398d5824b14 100644 --- a/src/main/java/net/minecraft/server/players/GameProfileCache.java @@ -50,7 +50,7 @@ index aeb0c7ce9b6f93dadd407dbdefba053568f2e2fe..416b26c2ab62b29d640169166980e398 }, this.executor); diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -index 6097e0ab387cfa4c2c9ab0389fc5bb6cd899ecc3..ebba6bc5b337d19e32be5a78294501ed8300f2bd 100644 +index f720c5ef71edd65de76bcac9632173184576ea9e..c278caa030ceccec8e2721068848a34be513de88 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java @@ -105,7 +105,7 @@ public class SkullBlockEntity extends BlockEntity { diff --git a/patches/unapplied/server/0138-Basic-PlayerProfile-API.patch b/patches/server/0137-Basic-PlayerProfile-API.patch similarity index 99% rename from patches/unapplied/server/0138-Basic-PlayerProfile-API.patch rename to patches/server/0137-Basic-PlayerProfile-API.patch index df363fcca6..fdc6f937d4 100644 --- a/patches/unapplied/server/0138-Basic-PlayerProfile-API.patch +++ b/patches/server/0137-Basic-PlayerProfile-API.patch @@ -625,10 +625,10 @@ index 416b26c2ab62b29d640169166980e398d5824b14..774d81c702edb76a2f6184d4dc53687d String s1 = name.toLowerCase(Locale.ROOT); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e9aa21a1ca5a3406f8ab40e1ce75f9e0ab6ddf5a..1182f5582b59a07a53a5b76b446326c05fe24411 100644 +index 859719521b07f061103a5e27a2c134849ecb9b08..dc20e2a838d19b378f76592d8eeeb1eaf150393d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -261,6 +261,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; +@@ -262,6 +262,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; import net.md_5.bungee.api.chat.BaseComponent; // Spigot @@ -638,7 +638,7 @@ index e9aa21a1ca5a3406f8ab40e1ce75f9e0ab6ddf5a..1182f5582b59a07a53a5b76b446326c0 public final class CraftServer implements Server { private final String serverName = io.papermc.paper.ServerBuildInfo.buildInfo().brandName(); // Paper private final String serverVersion; -@@ -305,6 +308,7 @@ public final class CraftServer implements Server { +@@ -307,6 +310,7 @@ public final class CraftServer implements Server { static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); ConfigurationSerialization.registerClass(CraftPlayerProfile.class); @@ -646,7 +646,7 @@ index e9aa21a1ca5a3406f8ab40e1ce75f9e0ab6ddf5a..1182f5582b59a07a53a5b76b446326c0 CraftItemFactory.instance(); CraftEntityFactory.instance(); } -@@ -2827,5 +2831,39 @@ public final class CraftServer implements Server { +@@ -2835,5 +2839,39 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/unapplied/server/0139-Add-UnknownCommandEvent.patch b/patches/server/0138-Add-UnknownCommandEvent.patch similarity index 93% rename from patches/unapplied/server/0139-Add-UnknownCommandEvent.patch rename to patches/server/0138-Add-UnknownCommandEvent.patch index 19dbcd1985..487c1c0cf0 100644 --- a/patches/unapplied/server/0139-Add-UnknownCommandEvent.patch +++ b/patches/server/0138-Add-UnknownCommandEvent.patch @@ -25,10 +25,10 @@ index ec34e402104d7a696ea95e0b11ee70189b678ab9..d9fc3c25bef251df6a53ee47ec224b07 } diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java -index b81a4204a85e5b431cd6137fd8b80e43779c97b7..eec5279ac4386132fa053c57889e32e6b8141614 100644 +index f94c0106b44d614483184e372c01c1504cb886b0..72756ef14b8ec8afd80313b9f6aaf76722cb18cf 100644 --- a/src/main/java/net/minecraft/commands/Commands.java +++ b/src/main/java/net/minecraft/commands/Commands.java -@@ -331,7 +331,7 @@ public class Commands { +@@ -329,7 +329,7 @@ public class Commands { commandlistenerwrapper.getServer().getProfiler().push(() -> { return "/" + s; }); @@ -37,7 +37,7 @@ index b81a4204a85e5b431cd6137fd8b80e43779c97b7..eec5279ac4386132fa053c57889e32e6 try { if (contextchain != null) { -@@ -365,14 +365,18 @@ public class Commands { +@@ -363,14 +363,18 @@ public class Commands { } @Nullable @@ -58,7 +58,7 @@ index b81a4204a85e5b431cd6137fd8b80e43779c97b7..eec5279ac4386132fa053c57889e32e6 if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) { int i = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor()); MutableComponent ichatmutablecomponent = Component.empty().withStyle(ChatFormatting.GRAY).withStyle((chatmodifier) -> { -@@ -391,7 +395,17 @@ public class Commands { +@@ -389,7 +393,17 @@ public class Commands { } ichatmutablecomponent.append((Component) Component.translatable("command.context.here").withStyle(ChatFormatting.RED, ChatFormatting.ITALIC)); @@ -78,10 +78,10 @@ index b81a4204a85e5b431cd6137fd8b80e43779c97b7..eec5279ac4386132fa053c57889e32e6 return null; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 1182f5582b59a07a53a5b76b446326c05fe24411..3c3f1b8b0885a1db6859718ee0ce0637153f012a 100644 +index dc20e2a838d19b378f76592d8eeeb1eaf150393d..e782c6d776f467d29540851eef9428f4d7f80acb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -936,7 +936,13 @@ public final class CraftServer implements Server { +@@ -939,7 +939,13 @@ public final class CraftServer implements Server { // Spigot start if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { diff --git a/patches/unapplied/server/0140-Shoulder-Entities-Release-API.patch b/patches/server/0139-Shoulder-Entities-Release-API.patch similarity index 96% rename from patches/unapplied/server/0140-Shoulder-Entities-Release-API.patch rename to patches/server/0139-Shoulder-Entities-Release-API.patch index 9db14c66fd..9facd3b0cf 100644 --- a/patches/unapplied/server/0140-Shoulder-Entities-Release-API.patch +++ b/patches/server/0139-Shoulder-Entities-Release-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 0654cca68acefccec82cc138acba30515a336cfb..e81acc5c982cd14bc8a3aa5bf06e9636179b8555 100644 +index c9423872c23f3334afad34e662041c5f5d1ad1a2..d603a7211c7e7eb2567881a530ae7bcbc8def5a6 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1982,20 +1982,45 @@ public abstract class Player extends LivingEntity { +@@ -1992,20 +1992,45 @@ public abstract class Player extends LivingEntity { } diff --git a/patches/unapplied/server/0141-Profile-Lookup-Events.patch b/patches/server/0140-Profile-Lookup-Events.patch similarity index 100% rename from patches/unapplied/server/0141-Profile-Lookup-Events.patch rename to patches/server/0140-Profile-Lookup-Events.patch diff --git a/patches/unapplied/server/0142-Block-player-logins-during-server-shutdown.patch b/patches/server/0141-Block-player-logins-during-server-shutdown.patch similarity index 88% rename from patches/unapplied/server/0142-Block-player-logins-during-server-shutdown.patch rename to patches/server/0141-Block-player-logins-during-server-shutdown.patch index 0a09c804d3..0dc0c7b69b 100644 --- a/patches/unapplied/server/0142-Block-player-logins-during-server-shutdown.patch +++ b/patches/server/0141-Block-player-logins-during-server-shutdown.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Block player logins during server shutdown diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index d342d569eb93707bc683c3373ea88ae6b885a476..da300bbe01399eec9d45f68aeb7c214cab4108fb 100644 +index 6b490eb5b14cb2d3174aff79d1144c87665c7d38..556a7d082f0c33606a0231aa1b52d0c12d57035c 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -95,6 +95,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -97,6 +97,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @Override public void tick() { diff --git a/patches/unapplied/server/0143-Entity-fromMobSpawner.patch b/patches/server/0142-Entity-fromMobSpawner.patch similarity index 86% rename from patches/unapplied/server/0143-Entity-fromMobSpawner.patch rename to patches/server/0142-Entity-fromMobSpawner.patch index 6f6195d1e9..b820f72bdc 100644 --- a/patches/unapplied/server/0143-Entity-fromMobSpawner.patch +++ b/patches/server/0142-Entity-fromMobSpawner.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 660a210c363fcb42145b273ea6b977ce4844505d..655ce0b58cc327a8dac1b006bec7dcb34964da0a 100644 +index 78cb145f72efaaf535b6f933b3ca990a3f909608..439e8b4f52ba88456fb8ae5ab960d715f5c0d131 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -396,6 +396,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -402,6 +402,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public void inactiveTick() { } // Spigot end protected int numCollisions = 0; // Paper - Cap entity collisions @@ -16,7 +16,7 @@ index 660a210c363fcb42145b273ea6b977ce4844505d..655ce0b58cc327a8dac1b006bec7dcb3 // Paper start - Entity origin API @javax.annotation.Nullable private org.bukkit.util.Vector origin; -@@ -2189,6 +2190,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2259,6 +2260,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } @@ -27,7 +27,7 @@ index 660a210c363fcb42145b273ea6b977ce4844505d..655ce0b58cc327a8dac1b006bec7dcb3 // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -2329,6 +2334,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -2399,6 +2404,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.originWorld = originWorld; origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2)); } @@ -49,10 +49,10 @@ index aa54237205989f619ac6a3faa2e4285427b9e31d..43d399e1a0ba2fb0541f851a28032fa6 if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { continue; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 3390033bbfc8fd0715458e5faa6a65477272a80b..88e0ac38214c537ea8be5d23a17ac5a58acd3682 100644 +index df6da730134da754d0ff23bd1b57c82486b9ab73..69b5946625a53a1351ffc4bdf61c6874949bbeae 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -993,4 +993,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1010,4 +1010,11 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return originVector.toLocation(world); } // Paper end - entity origin API diff --git a/patches/unapplied/server/0144-Improve-the-Saddle-API-for-Horses.patch b/patches/server/0143-Improve-the-Saddle-API-for-Horses.patch similarity index 100% rename from patches/unapplied/server/0144-Improve-the-Saddle-API-for-Horses.patch rename to patches/server/0143-Improve-the-Saddle-API-for-Horses.patch diff --git a/patches/unapplied/server/0145-ensureServerConversions-API.patch b/patches/server/0144-ensureServerConversions-API.patch similarity index 87% rename from patches/unapplied/server/0145-ensureServerConversions-API.patch rename to patches/server/0144-ensureServerConversions-API.patch index 47fffe4352..6d2efdb422 100644 --- a/patches/unapplied/server/0145-ensureServerConversions-API.patch +++ b/patches/server/0144-ensureServerConversions-API.patch @@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index e8dd4ba93c09c514f3594f0d4b5f1167b719a17d..aa1d144dfffc780284fc0a955ff18b711dc8c7bf 100644 +index 78c96b43d611f70814b80a05dfded794858e2eda..612991750c89936790a4db64f9cc0e236d283d57 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -516,4 +516,12 @@ public final class CraftItemFactory implements ItemFactory { +@@ -527,4 +527,12 @@ public final class CraftItemFactory implements ItemFactory { return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName()); } // Paper end - Adventure diff --git a/patches/unapplied/server/0146-Implement-getI18NDisplayName.patch b/patches/server/0145-Implement-getI18NDisplayName.patch similarity index 89% rename from patches/unapplied/server/0146-Implement-getI18NDisplayName.patch rename to patches/server/0145-Implement-getI18NDisplayName.patch index 8fa3c96477..08fbbf2a7d 100644 --- a/patches/unapplied/server/0146-Implement-getI18NDisplayName.patch +++ b/patches/server/0145-Implement-getI18NDisplayName.patch @@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index aa1d144dfffc780284fc0a955ff18b711dc8c7bf..fa4de12ba4fdce7a632923af8007e888141904c8 100644 +index 612991750c89936790a4db64f9cc0e236d283d57..d1a214e8d8fd7fd774a9629d5ca2d9f7a14de0e7 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -524,4 +524,19 @@ public final class CraftItemFactory implements ItemFactory { +@@ -535,4 +535,19 @@ public final class CraftItemFactory implements ItemFactory { return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item)); } // Paper end - ensure server conversions API diff --git a/patches/unapplied/server/0147-ProfileWhitelistVerifyEvent.patch b/patches/server/0146-ProfileWhitelistVerifyEvent.patch similarity index 93% rename from patches/unapplied/server/0147-ProfileWhitelistVerifyEvent.patch rename to patches/server/0146-ProfileWhitelistVerifyEvent.patch index b11dd2a0d1..fdf3cb1943 100644 --- a/patches/unapplied/server/0147-ProfileWhitelistVerifyEvent.patch +++ b/patches/server/0146-ProfileWhitelistVerifyEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 5d7cf0bffae13ecbc460a0f0b74e110ef9380a14..d59f85d3a4385ebba1a93a9b10533f18b7386ab2 100644 +index bad29b6f6bf2859a876799a053eef0374b9d7140..1c3b21eaff8481724858cf3013dbfc2f210f317b 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -631,9 +631,9 @@ public abstract class PlayerList { +@@ -624,9 +624,9 @@ public abstract class PlayerList { // return chatmessage; event.disallow(PlayerLoginEvent.Result.KICK_BANNED, io.papermc.paper.adventure.PaperAdventure.asAdventure(ichatmutablecomponent)); // Paper - Adventure @@ -21,7 +21,7 @@ index 5d7cf0bffae13ecbc460a0f0b74e110ef9380a14..d59f85d3a4385ebba1a93a9b10533f18 } else if (this.getIpBans().isBanned(socketaddress) && !this.getIpBans().get(socketaddress).hasExpired()) { IpBanListEntry ipbanentry = this.ipBans.get(socketaddress); -@@ -1024,7 +1024,23 @@ public abstract class PlayerList { +@@ -993,7 +993,23 @@ public abstract class PlayerList { } public boolean isWhiteListed(GameProfile profile) { diff --git a/patches/unapplied/server/0148-Fix-this-stupid-bullshit.patch b/patches/server/0147-Fix-this-stupid-bullshit.patch similarity index 88% rename from patches/unapplied/server/0148-Fix-this-stupid-bullshit.patch rename to patches/server/0147-Fix-this-stupid-bullshit.patch index 69f01f1c6c..cc049a1a33 100644 --- a/patches/unapplied/server/0148-Fix-this-stupid-bullshit.patch +++ b/patches/server/0147-Fix-this-stupid-bullshit.patch @@ -9,10 +9,10 @@ modified in order to prevent merge conflicts when Spigot changes/disables the wa and to provide some level of hint without being disruptive. diff --git a/src/main/java/net/minecraft/server/Bootstrap.java b/src/main/java/net/minecraft/server/Bootstrap.java -index 26892378d27dadce25c178333188ba093dc1617b..a3a2097716430b30c9bac2581b9f67fe0c595bd2 100644 +index 8f1992188f7fd9e735569e099b36a7eafed47aae..061c89b985dafc79c808dd5f0e296b9fbac2fdfc 100644 --- a/src/main/java/net/minecraft/server/Bootstrap.java +++ b/src/main/java/net/minecraft/server/Bootstrap.java -@@ -44,7 +44,7 @@ public class Bootstrap { +@@ -43,7 +43,7 @@ public class Bootstrap { public static void bootStrap() { if (!Bootstrap.isBootstrapped) { // CraftBukkit start @@ -21,7 +21,7 @@ index 26892378d27dadce25c178333188ba093dc1617b..a3a2097716430b30c9bac2581b9f67fe switch (name) { case "DispenserRegistry": break; -@@ -58,7 +58,7 @@ public class Bootstrap { +@@ -57,7 +57,7 @@ public class Bootstrap { System.err.println("*** WARNING: This server jar is unsupported, use at your own risk. ***"); System.err.println("**********************************************************************"); break; @@ -31,12 +31,12 @@ index 26892378d27dadce25c178333188ba093dc1617b..a3a2097716430b30c9bac2581b9f67fe Bootstrap.isBootstrapped = true; Instant instant = Instant.now(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 04a12fc412693c689c2048e4d568225b10ccf17b..1f62158072d7503f0148a9af4e9fbebab30e6fd7 100644 +index 9515a6f72b54bc8926f10182143b2aa9b684a341..faa228698c7dd60bde0f3767cc27957ece04b8be 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -260,10 +260,12 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -3); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/unapplied/server/0149-LivingEntity-setKiller.patch b/patches/server/0148-LivingEntity-setKiller.patch similarity index 89% rename from patches/unapplied/server/0149-LivingEntity-setKiller.patch rename to patches/server/0148-LivingEntity-setKiller.patch index 9fd26436ef..f1c2b7065a 100644 --- a/patches/unapplied/server/0149-LivingEntity-setKiller.patch +++ b/patches/server/0148-LivingEntity-setKiller.patch @@ -7,10 +7,10 @@ Subject: [PATCH] LivingEntity#setKiller public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 4a2f49be0af5d88e0fe5dd8af00b77dd0da2f208..d77c31a8b41df69d11c1ce4b77975e9a38e317b3 100644 +index c36e4c1802e304853320576e0521dbc53cd25425..fe631496aa551a0029eff7b4d4a5daf16dddac50 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -405,6 +405,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -406,6 +406,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return this.getHandle().lastHurtByPlayer == null ? null : (Player) this.getHandle().lastHurtByPlayer.getBukkitEntity(); } diff --git a/patches/unapplied/server/0150-Ocelot-despawns-should-honor-nametags-and-leash.patch b/patches/server/0149-Ocelot-despawns-should-honor-nametags-and-leash.patch similarity index 90% rename from patches/unapplied/server/0150-Ocelot-despawns-should-honor-nametags-and-leash.patch rename to patches/server/0149-Ocelot-despawns-should-honor-nametags-and-leash.patch index 9dc664ab89..a61d1533c3 100644 --- a/patches/unapplied/server/0150-Ocelot-despawns-should-honor-nametags-and-leash.patch +++ b/patches/server/0149-Ocelot-despawns-should-honor-nametags-and-leash.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ocelot despawns should honor nametags and leash diff --git a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java -index af9f6696f52b0f44f3b4f897a5dbd174034682c3..2c7491edbb60e7ec6a208ea7292cd28a3f8f9e31 100644 +index 695f057d05d6651860d8d15be5a2b48a18a35d22..97f4cc522706ec5914672aa4fdfbc35edc94aeb6 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Ocelot.java +++ b/src/main/java/net/minecraft/world/entity/animal/Ocelot.java @@ -133,7 +133,7 @@ public class Ocelot extends Animal { diff --git a/patches/unapplied/server/0151-Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/patches/server/0150-Reset-spawner-timer-when-spawner-event-is-cancelled.patch similarity index 100% rename from patches/unapplied/server/0151-Reset-spawner-timer-when-spawner-event-is-cancelled.patch rename to patches/server/0150-Reset-spawner-timer-when-spawner-event-is-cancelled.patch diff --git a/patches/unapplied/server/0152-Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/0151-Allow-specifying-a-custom-authentication-servers-dow.patch similarity index 90% rename from patches/unapplied/server/0152-Allow-specifying-a-custom-authentication-servers-dow.patch rename to patches/server/0151-Allow-specifying-a-custom-authentication-servers-dow.patch index 8abd11f071..adf56dbfaf 100644 --- a/patches/unapplied/server/0152-Allow-specifying-a-custom-authentication-servers-dow.patch +++ b/patches/server/0151-Allow-specifying-a-custom-authentication-servers-dow.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow specifying a custom "authentication servers down" kick diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index da300bbe01399eec9d45f68aeb7c214cab4108fb..a5b627ce61187696dfce3746c7c06cbaaf1149f5 100644 +index 556a7d082f0c33606a0231aa1b52d0c12d57035c..d1a05c93ba7b9d1cb3427a4a90346b4364784846 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -301,7 +301,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -303,7 +303,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, ServerLoginPacketListenerImpl.LOGGER.warn("Authentication servers are down but will let them in anyway!"); ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(s1)); // Spigot } else { diff --git a/patches/unapplied/server/0153-Add-PlayerJumpEvent.patch b/patches/server/0152-Add-PlayerJumpEvent.patch similarity index 94% rename from patches/unapplied/server/0153-Add-PlayerJumpEvent.patch rename to patches/server/0152-Add-PlayerJumpEvent.patch index d0a1375498..51e51eed46 100644 --- a/patches/unapplied/server/0153-Add-PlayerJumpEvent.patch +++ b/patches/server/0152-Add-PlayerJumpEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index df0cc552024c64c7e4f53386a75f8fee3008155b..196682a91c47ed2c4d2a8e1b71728200cc22191c 100644 +index 934faa4f5f40f3b0b63bc8be970b92d5219d9aeb..3425921cc7b0ccfc10dbb52da54d39e7f0d701e5 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1204,7 +1204,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1199,7 +1199,34 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl boolean flag1 = d7 > 0.0D; if (this.player.onGround() && !packet.isOnGround() && flag1) { diff --git a/patches/unapplied/server/0154-handle-ServerboundKeepAlivePacket-async.patch b/patches/server/0153-handle-ServerboundKeepAlivePacket-async.patch similarity index 93% rename from patches/unapplied/server/0154-handle-ServerboundKeepAlivePacket-async.patch rename to patches/server/0153-handle-ServerboundKeepAlivePacket-async.patch index b7fa733d4a..cc671fd5ce 100644 --- a/patches/unapplied/server/0154-handle-ServerboundKeepAlivePacket-async.patch +++ b/patches/server/0153-handle-ServerboundKeepAlivePacket-async.patch @@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index fc2fd0842e25fbe5c46ae07200c4b1a5950ae29a..8cc454ad3f6b865253bdd4902fbf19fc4a3e4a7f 100644 +index e8d1ade5542dcf01476ba8580cc281b28f36c9a0..0ac9f9d4816767ced7928a7d79743d97870a21a4 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -116,14 +116,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -117,14 +117,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack @Override public void handleKeepAlive(ServerboundKeepAlivePacket packet) { diff --git a/patches/unapplied/server/0155-Expose-client-protocol-version-and-virtual-host.patch b/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch similarity index 91% rename from patches/unapplied/server/0155-Expose-client-protocol-version-and-virtual-host.patch rename to patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch index 50ecf2b2fd..c91ab4fbe8 100644 --- a/patches/unapplied/server/0155-Expose-client-protocol-version-and-virtual-host.patch +++ b/patches/server/0154-Expose-client-protocol-version-and-virtual-host.patch @@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..a5a7624f1f372a26b982836cd31cff15 + +} diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 0ccfdceea8e211c595be2dad2392876109b4eeef..1321b9adba4c9e45dce0f717d44a7cb4e64b9bf6 100644 +index f5e6610d271ef2c997fb3d1a5f65e0bf0740805a..4ce0aaaeebe7b333491e3d8aece212c1378297c1 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -120,6 +120,10 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -75,10 +75,10 @@ index 0ccfdceea8e211c595be2dad2392876109b4eeef..1321b9adba4c9e45dce0f717d44a7cb4 // Paper start - add utility methods public final net.minecraft.server.level.ServerPlayer getPlayer() { diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -index 9214fb6b8e21ff6aee8be0691f1fe6e41c901ba3..65333e0244d7c3c415266f1740929761ca890af7 100644 +index 7ae4279768b70a4fdc8f4438898871a17c8fe402..582bbb376c75ab5bf737f3015ce8ad453746e279 100644 --- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java -@@ -69,6 +69,10 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL +@@ -70,6 +70,10 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL throw new UnsupportedOperationException("Invalid intention " + String.valueOf(packet.intention())); } @@ -90,10 +90,10 @@ index 9214fb6b8e21ff6aee8be0691f1fe6e41c901ba3..65333e0244d7c3c415266f1740929761 private void beginLogin(ClientIntentionPacket packet, boolean transfer) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8a6ce3d9eda1aa14577c4441d3f3d76fb6750f69..01fd0d05eb2c71d12252eeeda87f88ee903dd167 100644 +index 591dac203a4b93630fd4b1a95f44aaa364571cd8..a62a00e7f60f1fef625131597ca39bd5a10f7331 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -332,6 +332,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -334,6 +334,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().transferCookieConnection.sendPacket(new ClientboundTransferPacket(host, port)); } diff --git a/patches/unapplied/server/0156-revert-serverside-behavior-of-keepalives.patch b/patches/server/0155-revert-serverside-behavior-of-keepalives.patch similarity index 93% rename from patches/unapplied/server/0156-revert-serverside-behavior-of-keepalives.patch rename to patches/server/0155-revert-serverside-behavior-of-keepalives.patch index 167f18e6c9..1e370538f2 100644 --- a/patches/unapplied/server/0156-revert-serverside-behavior-of-keepalives.patch +++ b/patches/server/0155-revert-serverside-behavior-of-keepalives.patch @@ -17,10 +17,10 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -index 8cc454ad3f6b865253bdd4902fbf19fc4a3e4a7f..a0dc17702fb6c8c96f262bc917624a46a40920fa 100644 +index 0ac9f9d4816767ced7928a7d79743d97870a21a4..e2a07d4e006d90132102a6449d57dd9e9642e6af 100644 --- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java -@@ -68,7 +68,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -69,7 +69,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack protected final MinecraftServer server; public final Connection connection; // Paper private final boolean transferred; @@ -29,7 +29,7 @@ index 8cc454ad3f6b865253bdd4902fbf19fc4a3e4a7f..a0dc17702fb6c8c96f262bc917624a46 private boolean keepAlivePending; private long keepAliveChallenge; private long closedListenerTime; -@@ -76,6 +76,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -77,6 +77,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack private int latency; private volatile boolean suspendFlushingOnServerThread = false; public final java.util.Map packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks @@ -37,7 +37,7 @@ index 8cc454ad3f6b865253bdd4902fbf19fc4a3e4a7f..a0dc17702fb6c8c96f262bc917624a46 public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit this.server = minecraftserver; -@@ -226,18 +227,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack +@@ -227,18 +228,22 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack protected void keepConnectionAlive() { this.server.getProfiler().push("keepAlive"); diff --git a/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch new file mode 100644 index 0000000000..8645b2df0d --- /dev/null +++ b/patches/server/0156-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -0,0 +1,105 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Brokkonaut +Date: Tue, 31 Oct 2017 03:26:18 +0100 +Subject: [PATCH] Send attack SoundEffects only to players who can see the + attacker + + +diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java +index d603a7211c7e7eb2567881a530ae7bcbc8def5a6..0e14f9f233a1f41e9b660e19950820c9cd1913a5 100644 +--- a/src/main/java/net/minecraft/world/entity/player/Player.java ++++ b/src/main/java/net/minecraft/world/entity/player/Player.java +@@ -1256,7 +1256,7 @@ public abstract class Player extends LivingEntity { + boolean flag1; + + if (this.isSprinting() && flag) { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility + flag1 = true; + } else { + flag1 = false; +@@ -1335,9 +1335,9 @@ public abstract class Player extends LivingEntity { + } + } + +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); +- this.sweepAttack(); +- } ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility ++ this.sweepAttack(); ++ } + + if (target instanceof ServerPlayer && target.hurtMarked) { + // CraftBukkit start - Add Velocity Event +@@ -1362,18 +1362,18 @@ public abstract class Player extends LivingEntity { + // CraftBukkit end + } + +- if (flag2) { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); +- this.crit(target); +- } ++ if (flag2) { ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility ++ this.crit(target); ++ } + +- if (!flag2 && !flag3) { +- if (flag) { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); +- } else { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); ++ if (!flag2 && !flag3) { ++ if (flag) { ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility ++ } else { ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility ++ } + } +- } + + if (f1 > 0.0F) { + this.magicCrit(target); +@@ -1425,16 +1425,19 @@ public abstract class Player extends LivingEntity { + } + } + +- this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value +- } else { +- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); +- // CraftBukkit start - resync on cancelled event +- if (this instanceof ServerPlayer) { +- ((ServerPlayer) this).getBukkitEntity().updateInventory(); ++ this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value ++ } else { ++ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility ++ if (flag4) { ++ target.clearFire(); ++ } ++ // CraftBukkit start - resync on cancelled event ++ if (this instanceof ServerPlayer) { ++ ((ServerPlayer) this).getBukkitEntity().updateInventory(); ++ } ++ // CraftBukkit end + } +- // CraftBukkit end + } +- } + + } + } +@@ -1822,6 +1825,14 @@ public abstract class Player extends LivingEntity { + public int getXpNeededForNextLevel() { + return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); + } ++ // Paper start - send while respecting visibility ++ private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { ++ fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself ++ if (fromEntity instanceof ServerPlayer) { ++ ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong())); ++ } ++ } ++ // Paper end - send while respecting visibility + + // CraftBukkit start + public void causeFoodExhaustion(float exhaustion) { diff --git a/patches/unapplied/server/0158-Add-PlayerArmorChangeEvent.patch b/patches/server/0157-Add-PlayerArmorChangeEvent.patch similarity index 96% rename from patches/unapplied/server/0158-Add-PlayerArmorChangeEvent.patch rename to patches/server/0157-Add-PlayerArmorChangeEvent.patch index 3242378947..b0ad17cbab 100644 --- a/patches/unapplied/server/0158-Add-PlayerArmorChangeEvent.patch +++ b/patches/server/0157-Add-PlayerArmorChangeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index eafbe6fd829c2067b1e81ea8aad77fe3ba3df82f..2bb22c70c52a98abc0f4839ae67e9d27c320251a 100644 +index 57ba53cf9f84b21185bbaefd482f9d6dea2cb772..77365cfbaf6b9eb2ebefdf174066b40d120fc295 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3137,6 +3137,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3140,6 +3140,13 @@ public abstract class LivingEntity extends Entity implements Attackable { ItemStack itemstack2 = this.getItemBySlot(enumitemslot); if (this.equipmentHasChanged(itemstack1, itemstack2)) { diff --git a/patches/unapplied/server/0159-Prevent-logins-from-being-processed-when-the-player-.patch b/patches/server/0158-Prevent-logins-from-being-processed-when-the-player-.patch similarity index 87% rename from patches/unapplied/server/0159-Prevent-logins-from-being-processed-when-the-player-.patch rename to patches/server/0158-Prevent-logins-from-being-processed-when-the-player-.patch index f6552aac5d..d98153e8db 100644 --- a/patches/unapplied/server/0159-Prevent-logins-from-being-processed-when-the-player-.patch +++ b/patches/server/0158-Prevent-logins-from-being-processed-when-the-player-.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Prevent logins from being processed when the player has diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index a5b627ce61187696dfce3746c7c06cbaaf1149f5..2640041bfacda7612908c41e1506bf6668eb274f 100644 +index d1a05c93ba7b9d1cb3427a4a90346b4364784846..3bcce44fd8f7964a2f9b0d9c778b995975a8c049 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -102,7 +102,9 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -104,7 +104,9 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, } // Paper end - Do not allow logins while the server is shutting down if (this.state == ServerLoginPacketListenerImpl.State.VERIFYING) { diff --git a/patches/unapplied/server/0160-Fix-MC-117075-Block-entity-unload-lag-spike.patch b/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch similarity index 89% rename from patches/unapplied/server/0160-Fix-MC-117075-Block-entity-unload-lag-spike.patch rename to patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch index 4dda00330b..88b000fa9f 100644 --- a/patches/unapplied/server/0160-Fix-MC-117075-Block-entity-unload-lag-spike.patch +++ b/patches/server/0159-Fix-MC-117075-Block-entity-unload-lag-spike.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: Block entity unload lag spike diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index ec6640bc761b6232d6b48a32fae11e60d5cdcbdf..917ee31fedd92184d97f2c0a11fd61583361de92 100644 +index 4fcbea7b8b12be10157da0c1f35c06e47c0334ad..ab511f4c056f07aa79aab7b662073bb8db4b1526 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -721,6 +721,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -726,6 +726,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { boolean flag = this.tickRateManager().runsNormally(); int tilesThisCycle = 0; @@ -17,7 +17,7 @@ index ec6640bc761b6232d6b48a32fae11e60d5cdcbdf..917ee31fedd92184d97f2c0a11fd6158 for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0; TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition); -@@ -729,12 +731,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -734,12 +736,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable { if (tickingblockentity.isRemoved()) { // Spigot start tilesThisCycle--; diff --git a/patches/unapplied/server/0161-use-CB-BlockState-implementations-for-captured-block.patch b/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch similarity index 91% rename from patches/unapplied/server/0161-use-CB-BlockState-implementations-for-captured-block.patch rename to patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch index 50782d18cc..eb8b3bd4dc 100644 --- a/patches/unapplied/server/0161-use-CB-BlockState-implementations-for-captured-block.patch +++ b/patches/server/0160-use-CB-BlockState-implementations-for-captured-block.patch @@ -18,10 +18,10 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 917ee31fedd92184d97f2c0a11fd61583361de92..26adc305c5d5ef16dda141f931973666ee163d01 100644 +index ab511f4c056f07aa79aab7b662073bb8db4b1526..27e2718124aad69546c1d9adb9c8e69fa4a43ca7 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -149,7 +149,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -150,7 +150,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public boolean preventPoiUpdated = false; // CraftBukkit - SPIGOT-5710 public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; @@ -30,7 +30,7 @@ index 917ee31fedd92184d97f2c0a11fd61583361de92..26adc305c5d5ef16dda141f931973666 public Map capturedTileEntities = new HashMap<>(); public List captureDrops; public final it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap ticksPerSpawnCategory = new it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap<>(); -@@ -383,7 +383,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -384,7 +384,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public boolean setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) { // CraftBukkit start - tree generation if (this.captureTreeGeneration) { @@ -39,7 +39,7 @@ index 917ee31fedd92184d97f2c0a11fd61583361de92..26adc305c5d5ef16dda141f931973666 if (blockstate == null) { blockstate = CapturedBlockState.getTreeBlockState(this, pos, flags); this.capturedBlockStates.put(pos.immutable(), blockstate); -@@ -404,7 +404,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -405,7 +405,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit start - capture blockstates boolean captured = false; if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) { @@ -49,7 +49,7 @@ index 917ee31fedd92184d97f2c0a11fd61583361de92..26adc305c5d5ef16dda141f931973666 this.capturedBlockStates.put(pos.immutable(), blockstate); captured = true; } -@@ -605,7 +606,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -606,7 +607,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { public BlockState getBlockState(BlockPos pos) { // CraftBukkit start - tree generation if (this.captureTreeGeneration) { diff --git a/patches/unapplied/server/0162-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch similarity index 100% rename from patches/unapplied/server/0162-API-to-get-a-BlockState-without-a-snapshot.patch rename to patches/server/0161-API-to-get-a-BlockState-without-a-snapshot.patch diff --git a/patches/unapplied/server/0163-AsyncTabCompleteEvent.patch b/patches/server/0162-AsyncTabCompleteEvent.patch similarity index 97% rename from patches/unapplied/server/0163-AsyncTabCompleteEvent.patch rename to patches/server/0162-AsyncTabCompleteEvent.patch index 158da545b8..c00b7d4b3d 100644 --- a/patches/unapplied/server/0163-AsyncTabCompleteEvent.patch +++ b/patches/server/0162-AsyncTabCompleteEvent.patch @@ -16,10 +16,10 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent Co-authored-by: Aikar diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 196682a91c47ed2c4d2a8e1b71728200cc22191c..fffd671feb7a4e9805eafc473632b23225599b85 100644 +index 3425921cc7b0ccfc10dbb52da54d39e7f0d701e5..61f6a2449b6fa52eef597f8725ae076bd23cd8ea 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -708,21 +708,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -711,21 +711,58 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl } @@ -80,10 +80,10 @@ index 196682a91c47ed2c4d2a8e1b71728200cc22191c..fffd671feb7a4e9805eafc473632b232 this.server.getCommands().getDispatcher().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3c3f1b8b0885a1db6859718ee0ce0637153f012a..4dc7631babd1b433555fefbf33917af53868dec9 100644 +index e782c6d776f467d29540851eef9428f4d7f80acb..3b3fe9282251774516c8eae5890bd56645dd38e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2276,7 +2276,7 @@ public final class CraftServer implements Server { +@@ -2284,7 +2284,7 @@ public final class CraftServer implements Server { offers = this.tabCompleteChat(player, message); } diff --git a/patches/unapplied/server/0164-PlayerPickupExperienceEvent.patch b/patches/server/0163-PlayerPickupExperienceEvent.patch similarity index 64% rename from patches/unapplied/server/0164-PlayerPickupExperienceEvent.patch rename to patches/server/0163-PlayerPickupExperienceEvent.patch index 07f841a46d..591fd50b02 100644 --- a/patches/unapplied/server/0164-PlayerPickupExperienceEvent.patch +++ b/patches/server/0163-PlayerPickupExperienceEvent.patch @@ -6,15 +6,15 @@ Subject: [PATCH] PlayerPickupExperienceEvent Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index 0dd931a082a972cd62f80f32ef0c7177b0daf599..e40a6bb2055a09d6bf1a91f69a2abb5f6877a122 100644 +index 0330a62a6a0060d2a96de191db68774588fc7ae5..2d438cd3e69503fdc45a706f25c219af6f7a5db3 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -319,7 +319,7 @@ public class ExperienceOrb extends Entity { +@@ -322,7 +322,7 @@ public class ExperienceOrb extends Entity { @Override public void playerTouch(Player player) { - if (!this.level().isClientSide) { + if (player instanceof ServerPlayer entityplayer) { - if (player.takeXpDelay == 0) { -+ if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent ++ if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(entityplayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent player.takeXpDelay = CraftEventFactory.callPlayerXpCooldownEvent(player, 2, PlayerExpCooldownChangeEvent.ChangeReason.PICKUP_ORB).getNewCooldown(); // CraftBukkit - entityhuman.takeXpDelay = 2; player.take(this, 1); - int i = this.repairPlayerItems(player, this.value); + int i = this.repairPlayerItems(entityplayer, this.value); diff --git a/patches/unapplied/server/0165-Ability-to-apply-mending-to-XP-API.patch b/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch similarity index 94% rename from patches/unapplied/server/0165-Ability-to-apply-mending-to-XP-API.patch rename to patches/server/0164-Ability-to-apply-mending-to-XP-API.patch index f23ded7fbe..11e7b1ad53 100644 --- a/patches/unapplied/server/0165-Ability-to-apply-mending-to-XP-API.patch +++ b/patches/server/0164-Ability-to-apply-mending-to-XP-API.patch @@ -14,10 +14,10 @@ public net.minecraft.world.entity.ExperienceOrb durabilityToXp(I)I public net.minecraft.world.entity.ExperienceOrb xpToDurability(I)I diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 01fd0d05eb2c71d12252eeeda87f88ee903dd167..8b3e3d85ec11406143e7a9f447007615afecae2a 100644 +index a62a00e7f60f1fef625131597ca39bd5a10f7331..a72a320b6dd7b4477f5764f5f32334b519ade294 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1624,7 +1624,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1637,7 +1637,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } @Override diff --git a/patches/unapplied/server/0166-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch similarity index 89% rename from patches/unapplied/server/0166-PlayerNaturallySpawnCreaturesEvent.patch rename to patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch index df98aa55a0..f5479de5b0 100644 --- a/patches/unapplied/server/0166-PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/0165-PlayerNaturallySpawnCreaturesEvent.patch @@ -9,10 +9,10 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 15c9f4822d1d11d05de6c2d6797ee3e845b3a1ab..46da628073e2bfb77b3deab623dba46228d92618 100644 +index 6581566ca4e4fac0691e4f5851f8895d9ac7a38f..c96346bd0207537899d266fe2c8f29a1663e10c3 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -1221,7 +1221,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1101,7 +1101,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider chunkRange = (chunkRange > this.level.spigotConfig.viewDistance) ? (byte) this.level.spigotConfig.viewDistance : chunkRange; chunkRange = (chunkRange > 8) ? 8 : chunkRange; @@ -23,7 +23,7 @@ index 15c9f4822d1d11d05de6c2d6797ee3e845b3a1ab..46da628073e2bfb77b3deab623dba462 // Spigot end if (!this.distanceManager.hasPlayersNearby(chunkcoordintpair.toLong())) { return false; -@@ -1236,6 +1238,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -1116,6 +1118,15 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider } entityplayer = (ServerPlayer) iterator.next(); @@ -40,10 +40,10 @@ index 15c9f4822d1d11d05de6c2d6797ee3e845b3a1ab..46da628073e2bfb77b3deab623dba462 return true; diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index c4c85ba56c52a00e10e61fe0954d7fb8de471bdd..fe0521ad6f0601ebdf7a616c0500479ecb34cabb 100644 +index 946cf6e186c6b283e705aa9a8cc9726889ebb954..6032cdc1b169c8ed0890091bce5066fbbb73ae30 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -@@ -558,6 +558,15 @@ public class ServerChunkCache extends ChunkSource { +@@ -535,6 +535,15 @@ public class ServerChunkCache extends ChunkSource { boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit Util.shuffle(list, this.level.random); @@ -60,10 +60,10 @@ index c4c85ba56c52a00e10e61fe0954d7fb8de471bdd..fe0521ad6f0601ebdf7a616c0500479e boolean flag1 = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && this.level.getLevelData().getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit Iterator iterator1 = list.iterator(); diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 96bc2fa87502c363c68822d512e3c63c09a29513..53246654bf8154e723b26097e864f83fd203caa5 100644 +index a2d35f7066d89f861c1b75ec8a62f03ed6f65dd8..71eca7032aa2482bde7a2a00163f5547f3487b5e 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -282,6 +282,7 @@ public class ServerPlayer extends Player { +@@ -286,6 +286,7 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player { // CraftBukkit end public boolean isRealPlayer; // Paper public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper diff --git a/patches/unapplied/server/0167-Add-setPlayerProfile-API-for-Skulls.patch b/patches/server/0166-Add-setPlayerProfile-API-for-Skulls.patch similarity index 100% rename from patches/unapplied/server/0167-Add-setPlayerProfile-API-for-Skulls.patch rename to patches/server/0166-Add-setPlayerProfile-API-for-Skulls.patch diff --git a/patches/unapplied/server/0168-PreCreatureSpawnEvent.patch b/patches/server/0167-PreCreatureSpawnEvent.patch similarity index 98% rename from patches/unapplied/server/0168-PreCreatureSpawnEvent.patch rename to patches/server/0167-PreCreatureSpawnEvent.patch index 3ebb425a2c..0f4459f539 100644 --- a/patches/unapplied/server/0168-PreCreatureSpawnEvent.patch +++ b/patches/server/0167-PreCreatureSpawnEvent.patch @@ -55,7 +55,7 @@ index 3f2cad4c9c0400bf93932cb7f7219c2185fc7370..5c8e36ea8287029b1789719c687bac1a if (t0 != null) { diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 606dbc398745b689f957e62ebd9eaa56a67a61f3..7df13199eacc8dec0ba8fbf10ea507b0d1c5f591 100644 +index 474f020371bb9e5fd2c5b22e44d7902977c4fc18..69a661f01e43d17262fd2845dde5528416bbe456 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -430,6 +430,16 @@ public class EntityType implements FeatureElement, EntityTypeT @@ -76,10 +76,10 @@ index 606dbc398745b689f957e62ebd9eaa56a67a61f3..7df13199eacc8dec0ba8fbf10ea507b0 if (t0 != null) { diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index d1c3f5d076a3d560d02553d6a33e5890d0c2bfc7..4d7f95d2bd415bacccee145bfc47f2b480530c11 100644 +index 79fdc8284f57a4f11e1954936ad574f7b8df5435..e23674dd5db3c429efd3b7c71fe36b420494c03a 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -968,7 +968,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -970,7 +970,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler }).limit(5L).collect(Collectors.toList()); if (list1.size() >= requiredCount) { diff --git a/patches/unapplied/server/0169-Fill-Profile-Property-Events.patch b/patches/server/0168-Fill-Profile-Property-Events.patch similarity index 98% rename from patches/unapplied/server/0169-Fill-Profile-Property-Events.patch rename to patches/server/0168-Fill-Profile-Property-Events.patch index ef1f330999..4a73aa80a3 100644 --- a/patches/unapplied/server/0169-Fill-Profile-Property-Events.patch +++ b/patches/server/0168-Fill-Profile-Property-Events.patch @@ -59,7 +59,7 @@ index d8ed3404e8c3c61b2daff110ef32ef890a77a461..78863e72239a0f3535bc85758479da84 return new ResolvableProfile(gameProfile); }) : SkullBlockEntity.fetchGameProfile(this.name.orElseThrow()).thenApply(profile -> { diff --git a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java -index ebba6bc5b337d19e32be5a78294501ed8300f2bd..81d9a4e6bc1bc4f992ecb77b176daf89d645bbf2 100644 +index c278caa030ceccec8e2721068848a34be513de88..26e92e208ddd3122da6d44767b8841d7a8b90d98 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SkullBlockEntity.java @@ -41,7 +41,7 @@ public class SkullBlockEntity extends BlockEntity { diff --git a/patches/unapplied/server/0170-Add-PlayerAdvancementCriterionGrantEvent.patch b/patches/server/0169-Add-PlayerAdvancementCriterionGrantEvent.patch similarity index 92% rename from patches/unapplied/server/0170-Add-PlayerAdvancementCriterionGrantEvent.patch rename to patches/server/0169-Add-PlayerAdvancementCriterionGrantEvent.patch index d407c53d24..ddac15d311 100644 --- a/patches/unapplied/server/0170-Add-PlayerAdvancementCriterionGrantEvent.patch +++ b/patches/server/0169-Add-PlayerAdvancementCriterionGrantEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAdvancementCriterionGrantEvent diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java -index 5657391bfe6272b70fbf7d2732d46994832c39f9..6e8ccafe8966970d1665be21266f2ffe95e1d3ed 100644 +index 81bef7427478fe911e81f024102654d8d540dbb7..4c85abf29441645039b6a554a50e1d3274229de6 100644 --- a/src/main/java/net/minecraft/server/PlayerAdvancements.java +++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java @@ -225,6 +225,12 @@ public class PlayerAdvancements { diff --git a/patches/unapplied/server/0171-Add-ArmorStand-Item-Meta.patch b/patches/server/0170-Add-ArmorStand-Item-Meta.patch similarity index 98% rename from patches/unapplied/server/0171-Add-ArmorStand-Item-Meta.patch rename to patches/server/0170-Add-ArmorStand-Item-Meta.patch index 10b1236f86..345e7b4ffd 100644 --- a/patches/unapplied/server/0171-Add-ArmorStand-Item-Meta.patch +++ b/patches/server/0170-Add-ArmorStand-Item-Meta.patch @@ -13,10 +13,10 @@ starting point for future additions in this area. Fixes GH-559 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -index 7c7b85972d6a97cc325bf86a836ef208f00dbb37..8d484ba6ed0f7917cf281ff67b1f2b0c2c5c81d8 100644 +index 3006a6d19de35e7e0d6e542e80eb0406c5422c3e..fc522ae106d1172172c496da543b8ca403e73456 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemType.java -@@ -67,7 +67,7 @@ public class CraftItemType implements ItemType.Typed, Han +@@ -66,7 +66,7 @@ public class CraftItemType implements ItemType.Typed, Han private Class getItemMetaClass(Item item) { ItemMeta meta = new ItemStack(this.asMaterial()).getItemMeta(); if (meta != null) { diff --git a/patches/unapplied/server/0172-Extend-Player-Interact-cancellation.patch b/patches/server/0171-Extend-Player-Interact-cancellation.patch similarity index 92% rename from patches/unapplied/server/0172-Extend-Player-Interact-cancellation.patch rename to patches/server/0171-Extend-Player-Interact-cancellation.patch index 3062db9468..0317d6e0e4 100644 --- a/patches/unapplied/server/0172-Extend-Player-Interact-cancellation.patch +++ b/patches/server/0171-Extend-Player-Interact-cancellation.patch @@ -10,10 +10,10 @@ Flower pots are also not updated on the client when interaction is cancelled, th also resolves this. diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index f4bf927477af23365a2d4618a1634195bd2054c8..e2d8bb349591d103606b158bc116b09d333c87ce 100644 +index 2fab84c5e2dc4de39281956390588a9a71d02f68..a5b0efd6142075ca1ecb604afbc1d0162199e7a4 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -514,7 +514,11 @@ public class ServerPlayerGameMode { +@@ -519,7 +519,11 @@ public class ServerPlayerGameMode { // send a correcting update to the client for the block above as well, this because of replaceable blocks (such as grass, sea grass etc) player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above())); diff --git a/patches/unapplied/server/0173-Tameable-getOwnerUniqueId-API.patch b/patches/server/0172-Tameable-getOwnerUniqueId-API.patch similarity index 100% rename from patches/unapplied/server/0173-Tameable-getOwnerUniqueId-API.patch rename to patches/server/0172-Tameable-getOwnerUniqueId-API.patch diff --git a/patches/server/0173-Toggleable-player-crits.patch b/patches/server/0173-Toggleable-player-crits.patch new file mode 100644 index 0000000000..3af58a3d60 --- /dev/null +++ b/patches/server/0173-Toggleable-player-crits.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MiniDigger +Date: Sat, 10 Mar 2018 00:50:24 +0100 +Subject: [PATCH] Toggleable player crits + + +diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java +index 0e14f9f233a1f41e9b660e19950820c9cd1913a5..92ff2ccfbcc554281a70337a0a759bf6f2e2bca0 100644 +--- a/src/main/java/net/minecraft/world/entity/player/Player.java ++++ b/src/main/java/net/minecraft/world/entity/player/Player.java +@@ -1265,6 +1265,7 @@ public abstract class Player extends LivingEntity { + f += itemstack.getItem().getAttackDamageBonus(target, f, damagesource); + boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); + ++ flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits + if (flag2) { + f *= 1.5F; + } diff --git a/patches/unapplied/server/0175-Disable-Explicit-Network-Manager-Flushing.patch b/patches/server/0174-Disable-Explicit-Network-Manager-Flushing.patch similarity index 91% rename from patches/unapplied/server/0175-Disable-Explicit-Network-Manager-Flushing.patch rename to patches/server/0174-Disable-Explicit-Network-Manager-Flushing.patch index 7795462dbe..583fa8e586 100644 --- a/patches/unapplied/server/0175-Disable-Explicit-Network-Manager-Flushing.patch +++ b/patches/server/0174-Disable-Explicit-Network-Manager-Flushing.patch @@ -12,7 +12,7 @@ flushing on the netty event loop, so it won't do the flush on the main thread. Renable flushing by passing -Dpaper.explicit-flush=true diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index 1321b9adba4c9e45dce0f717d44a7cb4e64b9bf6..42c0723e2fe43e1f268119a16067e8bdfb971208 100644 +index 4ce0aaaeebe7b333491e3d8aece212c1378297c1..c45b8b2c89ffec7bd6a6875963c61f11185d3ee1 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java @@ -123,6 +123,7 @@ public class Connection extends SimpleChannelInboundHandler> { @@ -23,7 +23,7 @@ index 1321b9adba4c9e45dce0f717d44a7cb4e64b9bf6..42c0723e2fe43e1f268119a16067e8bd // Paper end // Paper start - add utility methods -@@ -449,7 +450,7 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -457,7 +458,7 @@ public class Connection extends SimpleChannelInboundHandler> { } if (this.channel != null) { diff --git a/patches/unapplied/server/0176-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch similarity index 95% rename from patches/unapplied/server/0176-Implement-extended-PaperServerListPingEvent.patch rename to patches/server/0175-Implement-extended-PaperServerListPingEvent.patch index 355f258a48..e583417246 100644 --- a/patches/unapplied/server/0176-Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch @@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1fdd088f0bb6606f2a9a482d276aa3e9261be012..b6c5656665e492a7fdec0ae15545ecbabf585336 100644 +index 7335f9bb936eeb585ee077b0b9c461d7946d6134..1c024fb7f682c81c465f59f4ab5fbeac964d73e1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -3,6 +3,9 @@ package net.minecraft.server; @@ -194,7 +194,7 @@ index 1fdd088f0bb6606f2a9a482d276aa3e9261be012..b6c5656665e492a7fdec0ae15545ecba import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1490,7 +1493,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop Co-authored-by: MCMDEV diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 2640041bfacda7612908c41e1506bf6668eb274f..43c77bef408c016ee40454bdebb8662929a0b7f0 100644 +index 3bcce44fd8f7964a2f9b0d9c778b995975a8c049..2d9db1ac80216a509a7590254e422b3c4792e3ec 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -184,7 +184,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -186,7 +186,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, try { GameProfile gameprofile = ServerLoginPacketListenerImpl.this.createOfflineProfile(ServerLoginPacketListenerImpl.this.requestedUsername); // Spigot @@ -19,7 +19,7 @@ index 2640041bfacda7612908c41e1506bf6668eb274f..43c77bef408c016ee40454bdebb86629 ServerLoginPacketListenerImpl.LOGGER.info("UUID of player {} is {}", gameprofile.getName(), gameprofile.getId()); ServerLoginPacketListenerImpl.this.startClientVerification(gameprofile); } catch (Exception ex) { -@@ -287,7 +287,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -289,7 +289,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, if (!ServerLoginPacketListenerImpl.this.connection.isConnected()) { return; } @@ -28,7 +28,7 @@ index 2640041bfacda7612908c41e1506bf6668eb274f..43c77bef408c016ee40454bdebb86629 // CraftBukkit end ServerLoginPacketListenerImpl.LOGGER.info("UUID of player {} is {}", gameprofile.getName(), gameprofile.getId()); ServerLoginPacketListenerImpl.this.startClientVerification(gameprofile); -@@ -326,14 +326,23 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -328,14 +328,23 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, } // CraftBukkit start @@ -54,7 +54,7 @@ index 2640041bfacda7612908c41e1506bf6668eb274f..43c77bef408c016ee40454bdebb86629 if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); -@@ -351,14 +360,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -353,14 +362,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable); if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.kickMessage())); // Paper - Adventure diff --git a/patches/unapplied/server/0178-Player.setPlayerProfile-API.patch b/patches/server/0177-Player.setPlayerProfile-API.patch similarity index 91% rename from patches/unapplied/server/0178-Player.setPlayerProfile-API.patch rename to patches/server/0177-Player.setPlayerProfile-API.patch index c92e9f81c5..c8bb5b87a0 100644 --- a/patches/unapplied/server/0178-Player.setPlayerProfile-API.patch +++ b/patches/server/0177-Player.setPlayerProfile-API.patch @@ -9,10 +9,10 @@ This can be useful for changing name or skins after a player has logged in. public-f net.minecraft.world.entity.player.Player gameProfile diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index fffd671feb7a4e9805eafc473632b23225599b85..de772530d290d58c1d8270bd14915e37db8dbf42 100644 +index 61f6a2449b6fa52eef597f8725ae076bd23cd8ea..ecc2ce39629f6edbd09e96c85e14ab2196ac3173 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1459,7 +1459,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -1472,7 +1472,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl this.internalTeleport(dest.getX(), dest.getY(), dest.getZ(), dest.getYaw(), dest.getPitch(), Collections.emptySet()); } @@ -22,10 +22,10 @@ index fffd671feb7a4e9805eafc473632b23225599b85..de772530d290d58c1d8270bd14915e37 if (Float.isNaN(f)) { f = 0; diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 43c77bef408c016ee40454bdebb8662929a0b7f0..2ca467bd9c53a59f1ca9b8e1c2cf683182a71910 100644 +index 2d9db1ac80216a509a7590254e422b3c4792e3ec..b31f00f2f0b7cec59301afe36c9dd7cdc120fc9d 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -334,11 +334,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -336,11 +336,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, // Paper start - Add more fields to AsyncPlayerPreLoginEvent final InetAddress rawAddress = ((InetSocketAddress) this.connection.channel.remoteAddress()).getAddress(); @@ -40,10 +40,10 @@ index 43c77bef408c016ee40454bdebb8662929a0b7f0..2ca467bd9c53a59f1ca9b8e1c2cf6831 playerName = gameprofile.getName(); uniqueId = gameprofile.getId(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index d59f85d3a4385ebba1a93a9b10533f18b7386ab2..d25c762e449e2bce20487454ad52363b35b9af96 100644 +index 1c3b21eaff8481724858cf3013dbfc2f210f317b..8ff6b8ada1cfb9a4b344ba7d77db95f3ddcff6c5 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -862,10 +862,16 @@ public abstract class PlayerList { +@@ -831,10 +831,16 @@ public abstract class PlayerList { } public void sendPlayerPermissionLevel(ServerPlayer player) { @@ -77,10 +77,10 @@ index 818df09e9245b5d89b4180b1eaa51470b7539341..461656e1cb095243bfe7a9ee2906e5b0 public Server getServer() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8b3e3d85ec11406143e7a9f447007615afecae2a..627b957388bb52a779796b618fe8158a76be093e 100644 +index a72a320b6dd7b4477f5764f5f32334b519ade294..286b060081fdc0912b52a29d2425d1d208c4be9a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -247,11 +247,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -249,11 +249,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.server.getPlayer(this.getUniqueId()) != null; } @@ -92,7 +92,7 @@ index 8b3e3d85ec11406143e7a9f447007615afecae2a..627b957388bb52a779796b618fe8158a @Override public InetSocketAddress getAddress() { if (this.getHandle().connection.protocol() == null) return null; -@@ -1774,8 +1769,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1787,8 +1782,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private void untrackAndHideEntity(org.bukkit.entity.Entity entity) { // Remove this entity from the hidden player's EntityTrackerEntry @@ -109,7 +109,7 @@ index 8b3e3d85ec11406143e7a9f447007615afecae2a..627b957388bb52a779796b618fe8158a ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); if (entry != null) { entry.removePlayer(this.getHandle()); -@@ -1788,8 +1790,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1801,8 +1803,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.getHandle().connection.send(new ClientboundPlayerInfoRemovePacket(List.of(otherPlayer.getUUID()))); } } @@ -118,7 +118,7 @@ index 8b3e3d85ec11406143e7a9f447007615afecae2a..627b957388bb52a779796b618fe8158a } void resetAndHideEntity(org.bukkit.entity.Entity entity) { -@@ -1854,12 +1854,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1867,12 +1867,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } private void trackAndShowEntity(org.bukkit.entity.Entity entity) { @@ -144,7 +144,7 @@ index 8b3e3d85ec11406143e7a9f447007615afecae2a..627b957388bb52a779796b618fe8158a } ChunkMap.TrackedEntity entry = tracker.entityMap.get(other.getId()); -@@ -1869,6 +1882,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1882,6 +1895,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity)); } @@ -184,7 +184,7 @@ index 8b3e3d85ec11406143e7a9f447007615afecae2a..627b957388bb52a779796b618fe8158a void resetAndShowEntity(org.bukkit.entity.Entity entity) { // SPIGOT-7312: Can't show/hide self -@@ -1880,6 +1926,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1893,6 +1939,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.trackAndShowEntity(entity); } } @@ -220,10 +220,10 @@ index 8b3e3d85ec11406143e7a9f447007615afecae2a..627b957388bb52a779796b618fe8158a public void onEntityRemove(Entity entity) { this.invertedVisibilityEntities.remove(entity.getUUID()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index f45498bf9841c31338b83270c1badc6d7a792d25..5b71ef6231c6c44ebeabfb1fb39941806cb22b5c 100644 +index e8bdc9f97cc506ca8509480ea0c07facc778df8d..2d9453498531c99f4fa566a08099b4e5a7af25fa 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -374,6 +374,13 @@ public class Commodore { +@@ -379,6 +379,13 @@ public class Commodore { } // Paper end - Rewrite plugins diff --git a/patches/unapplied/server/0179-getPlayerUniqueId-API.patch b/patches/server/0178-getPlayerUniqueId-API.patch similarity index 90% rename from patches/unapplied/server/0179-getPlayerUniqueId-API.patch rename to patches/server/0178-getPlayerUniqueId-API.patch index 6b109e5aa1..e5fe109dd6 100644 --- a/patches/unapplied/server/0179-getPlayerUniqueId-API.patch +++ b/patches/server/0178-getPlayerUniqueId-API.patch @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4dc7631babd1b433555fefbf33917af53868dec9..c02ebe1a8fbae4cd01f5ad355b3a5530494fab73 100644 +index 3b3fe9282251774516c8eae5890bd56645dd38e4..dd1a6b7a65fe019ee71c659a165283ee9c0e7a4f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1875,6 +1875,25 @@ public final class CraftServer implements Server { +@@ -1878,6 +1878,25 @@ public final class CraftServer implements Server { return recipients.size(); } diff --git a/patches/unapplied/server/0180-Improved-Async-Task-Scheduler.patch b/patches/server/0179-Improved-Async-Task-Scheduler.patch similarity index 100% rename from patches/unapplied/server/0180-Improved-Async-Task-Scheduler.patch rename to patches/server/0179-Improved-Async-Task-Scheduler.patch diff --git a/patches/unapplied/server/0181-Make-legacy-ping-handler-more-reliable.patch b/patches/server/0180-Make-legacy-ping-handler-more-reliable.patch similarity index 100% rename from patches/unapplied/server/0181-Make-legacy-ping-handler-more-reliable.patch rename to patches/server/0180-Make-legacy-ping-handler-more-reliable.patch diff --git a/patches/unapplied/server/0182-Call-PaperServerListPingEvent-for-legacy-pings.patch b/patches/server/0181-Call-PaperServerListPingEvent-for-legacy-pings.patch similarity index 100% rename from patches/unapplied/server/0182-Call-PaperServerListPingEvent-for-legacy-pings.patch rename to patches/server/0181-Call-PaperServerListPingEvent-for-legacy-pings.patch diff --git a/patches/unapplied/server/0183-Flag-to-disable-the-channel-limit.patch b/patches/server/0182-Flag-to-disable-the-channel-limit.patch similarity index 89% rename from patches/unapplied/server/0183-Flag-to-disable-the-channel-limit.patch rename to patches/server/0182-Flag-to-disable-the-channel-limit.patch index 6fb3312b58..39732e0b2b 100644 --- a/patches/unapplied/server/0183-Flag-to-disable-the-channel-limit.patch +++ b/patches/server/0182-Flag-to-disable-the-channel-limit.patch @@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 627b957388bb52a779796b618fe8158a76be093e..137e5f9a0ccf7e2a73db9e88100dd258e71ec170 100644 +index 286b060081fdc0912b52a29d2425d1d208c4be9a..a89bc6c124d05fd22848aaddac8ca496f3a324ca 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -207,6 +207,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -209,6 +209,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private CraftWorldBorder clientWorldBorder = null; private BorderChangeListener clientWorldBorderListener = this.createWorldBorderListener(); public org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; // Paper - more resource pack API @@ -20,7 +20,7 @@ index 627b957388bb52a779796b618fe8158a76be093e..137e5f9a0ccf7e2a73db9e88100dd258 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -2251,7 +2252,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2264,7 +2265,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/patches/unapplied/server/0184-Add-openSign-method-to-HumanEntity.patch b/patches/server/0183-Add-openSign-method-to-HumanEntity.patch similarity index 100% rename from patches/unapplied/server/0184-Add-openSign-method-to-HumanEntity.patch rename to patches/server/0183-Add-openSign-method-to-HumanEntity.patch diff --git a/patches/unapplied/server/0185-Configurable-sprint-interruption-on-attack.patch b/patches/server/0184-Configurable-sprint-interruption-on-attack.patch similarity index 62% rename from patches/unapplied/server/0185-Configurable-sprint-interruption-on-attack.patch rename to patches/server/0184-Configurable-sprint-interruption-on-attack.patch index 1b98985534..a57cf17454 100644 --- a/patches/unapplied/server/0185-Configurable-sprint-interruption-on-attack.patch +++ b/patches/server/0184-Configurable-sprint-interruption-on-attack.patch @@ -6,19 +6,18 @@ Subject: [PATCH] Configurable sprint interruption on attack If the sprint interruption is disabled players continue sprinting when they attack entities. diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 715a66018afa8d67f6e078e1157886390a2ad5dd..c7865bb6fa7fbeee365a70a4858b0addb36d4165 100644 +index 92ff2ccfbcc554281a70337a0a759bf6f2e2bca0..6ff215c3d6db1627eda20ba09a3e10eaba589d99 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1299,8 +1299,12 @@ public abstract class Player extends LivingEntity { - } +@@ -1307,6 +1307,11 @@ public abstract class Player extends LivingEntity { - this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); + this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D)); + this.setSprinting(false); + // Paper start - Configurable sprint interruption on attack + if (!this.level().paperConfig().misc.disableSprintInterruptionOnAttack) { - this.setSprinting(false); - } -+ // Paper end - Configurable sprint interruption on attack ++ this.setSprinting(false); + } ++ // Paper end - Configurable sprint interruption on attack + } - if (flag3) { - float f4 = 1.0F + EnchantmentHelper.getSweepingDamageRatio(this) * f; + LivingEntity entityliving2; diff --git a/patches/unapplied/server/0186-EndermanEscapeEvent.patch b/patches/server/0185-EndermanEscapeEvent.patch similarity index 89% rename from patches/unapplied/server/0186-EndermanEscapeEvent.patch rename to patches/server/0185-EndermanEscapeEvent.patch index 8508ed70d2..9a4685f868 100644 --- a/patches/unapplied/server/0186-EndermanEscapeEvent.patch +++ b/patches/server/0185-EndermanEscapeEvent.patch @@ -8,10 +8,10 @@ Fires an event anytime an enderman intends to teleport away from the player You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 7b6109348bbc44727ef7d0ef8fc08561f0dc328d..3e50f3dc5b9a45ee8f368f91fbd67b599d4435fb 100644 +index bbe024a88d0feeb02a5cc4248f4bcdd3a06daf04..51e9988685b1a9a3d4d2effec63560b0ae9e8d3a 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -119,6 +119,12 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -121,6 +121,12 @@ public class EnderMan extends Monster implements NeutralMob { this.setTarget(target, EntityTargetEvent.TargetReason.UNKNOWN, true); } @@ -24,7 +24,7 @@ index 7b6109348bbc44727ef7d0ef8fc08561f0dc328d..3e50f3dc5b9a45ee8f368f91fbd67b59 @Override public boolean setTarget(LivingEntity entityliving, EntityTargetEvent.TargetReason reason, boolean fireEvent) { if (!super.setTarget(entityliving, reason, fireEvent)) { -@@ -268,7 +274,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -270,7 +276,7 @@ public class EnderMan extends Monster implements NeutralMob { if (this.level().isDay() && this.tickCount >= this.targetChangeTime + 600) { float f = this.getLightLevelDependentMagicValue(); @@ -33,7 +33,7 @@ index 7b6109348bbc44727ef7d0ef8fc08561f0dc328d..3e50f3dc5b9a45ee8f368f91fbd67b59 this.setTarget((LivingEntity) null); this.teleport(); } -@@ -394,11 +400,13 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -396,11 +402,13 @@ public class EnderMan extends Monster implements NeutralMob { } else { flag1 = flag && this.hurtWithCleanWater(source, (ThrownPotion) source.getDirectEntity(), amount); @@ -47,7 +47,7 @@ index 7b6109348bbc44727ef7d0ef8fc08561f0dc328d..3e50f3dc5b9a45ee8f368f91fbd67b59 return flag1; } -@@ -623,7 +631,7 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -625,7 +633,7 @@ public class EnderMan extends Monster implements NeutralMob { } else { if (this.target != null && !this.enderman.isPassenger()) { if (this.enderman.isLookingAtMe((Player) this.target)) { diff --git a/patches/unapplied/server/0187-Enderman.teleportRandomly.patch b/patches/server/0186-Enderman.teleportRandomly.patch similarity index 100% rename from patches/unapplied/server/0187-Enderman.teleportRandomly.patch rename to patches/server/0186-Enderman.teleportRandomly.patch diff --git a/patches/unapplied/server/0188-Block-Enderpearl-Travel-Exploit.patch b/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch similarity index 87% rename from patches/unapplied/server/0188-Block-Enderpearl-Travel-Exploit.patch rename to patches/server/0187-Block-Enderpearl-Travel-Exploit.patch index 37ffcb8ff8..e76023350e 100644 --- a/patches/unapplied/server/0188-Block-Enderpearl-Travel-Exploit.patch +++ b/patches/server/0187-Block-Enderpearl-Travel-Exploit.patch @@ -16,10 +16,10 @@ public net.minecraft.world.entity.projectile.Projectile cachedOwner public net.minecraft.world.entity.projectile.Projectile ownerUUID diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 0a7dec5ff89c94503908ad011fe7da8dd8256685..f31d403420294f479e116013b200ea7e87ac901e 100644 +index 7c835a9328b1ba8426663ed3e9575fcd35a0f748..6107b880612e88d96527ff8ea029875882fb19a1 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2143,6 +2143,12 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2111,6 +2111,12 @@ public class ServerLevel extends Level implements WorldGenLevel { public void onTickingEnd(Entity entity) { ServerLevel.this.entityTickList.remove(entity); @@ -33,10 +33,10 @@ index 0a7dec5ff89c94503908ad011fe7da8dd8256685..f31d403420294f479e116013b200ea7e public void onTrackingStart(Entity entity) { diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 1e7224d070fc48d93ce0c4e832d94c6a50019249..5e9ef75a14a91f01a1ae5b3fb591d7258740a75d 100644 +index add45e6e95688649ba4b8d67747f763a261da51e..a39de724848d6dc796dd99dde5206f20e513fd18 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -102,6 +102,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -108,6 +108,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { if (nbt.hasUUID("Owner")) { this.ownerUUID = nbt.getUUID("Owner"); this.cachedOwner = null; diff --git a/patches/unapplied/server/0189-Expand-World.spawnParticle-API-and-add-Builder.patch b/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch similarity index 93% rename from patches/unapplied/server/0189-Expand-World.spawnParticle-API-and-add-Builder.patch rename to patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch index 12ab6069ab..02b852e5ae 100644 --- a/patches/unapplied/server/0189-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/patches/server/0188-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index f31d403420294f479e116013b200ea7e87ac901e..82947c9743433df9c03732e0a3229563de0ab53c 100644 +index 6107b880612e88d96527ff8ea029875882fb19a1..5bf18ab5c397b32d880ea1827f62945d8d0e80ce 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1510,12 +1510,17 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1508,12 +1508,17 @@ public class ServerLevel extends Level implements WorldGenLevel { } public int sendParticles(ServerPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { @@ -34,7 +34,7 @@ index f31d403420294f479e116013b200ea7e87ac901e..82947c9743433df9c03732e0a3229563 if (this.sendParticles(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 8fea8bc0117b5b9ebff1979a73783446b7afe228..6bca713e3cc3d63ec69b06cb7ec1820dd61cd88f 100644 +index 2794a7996147fce5533877a47cd1e7b6f7e7576f..14fe2bf55b1d00c1f79a1dbbbd6d22bf30ecc277 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1982,8 +1982,19 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/unapplied/server/0190-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch similarity index 100% rename from patches/unapplied/server/0190-Fix-exploit-that-allowed-colored-signs-to-be-created.patch rename to patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch diff --git a/patches/unapplied/server/0191-EndermanAttackPlayerEvent.patch b/patches/server/0190-EndermanAttackPlayerEvent.patch similarity index 90% rename from patches/unapplied/server/0191-EndermanAttackPlayerEvent.patch rename to patches/server/0190-EndermanAttackPlayerEvent.patch index ccd3efb275..a4e97fbce3 100644 --- a/patches/unapplied/server/0191-EndermanAttackPlayerEvent.patch +++ b/patches/server/0190-EndermanAttackPlayerEvent.patch @@ -8,10 +8,10 @@ Allow control over whether or not an enderman aggros a player. This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -index 3e50f3dc5b9a45ee8f368f91fbd67b599d4435fb..4d659fc8355542e6b9cadc6e1e86002e136702d2 100644 +index 51e9988685b1a9a3d4d2effec63560b0ae9e8d3a..70888dd25b6a1d1ab7702d73a64a47eebafe76fe 100644 --- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java +++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java -@@ -231,7 +231,15 @@ public class EnderMan extends Monster implements NeutralMob { +@@ -233,7 +233,15 @@ public class EnderMan extends Monster implements NeutralMob { this.readPersistentAngerSaveData(this.level(), nbt); } diff --git a/patches/unapplied/server/0192-WitchConsumePotionEvent.patch b/patches/server/0191-WitchConsumePotionEvent.patch similarity index 91% rename from patches/unapplied/server/0192-WitchConsumePotionEvent.patch rename to patches/server/0191-WitchConsumePotionEvent.patch index 8c307613d4..fead120a99 100644 --- a/patches/unapplied/server/0192-WitchConsumePotionEvent.patch +++ b/patches/server/0191-WitchConsumePotionEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] WitchConsumePotionEvent Fires when a witch consumes the potion in their hand diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java -index a64727fa7159f3e95f4eb44f02cb836f169b9b92..3e070a61a3099601e57d70ec663c4c6fb291c024 100644 +index a4d10409f06316ee628b683b231b3cc2a08bf593..f9cd71379a1d195731e7348ac6928372a4b2c29c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -122,6 +122,12 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -123,6 +123,12 @@ public class Witch extends Raider implements RangedAttackMob { this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY); PotionContents potioncontents = (PotionContents) itemstack.get(DataComponents.POTION_CONTENTS); diff --git a/patches/unapplied/server/0193-WitchThrowPotionEvent.patch b/patches/server/0192-WitchThrowPotionEvent.patch similarity index 91% rename from patches/unapplied/server/0193-WitchThrowPotionEvent.patch rename to patches/server/0192-WitchThrowPotionEvent.patch index 309ef84532..d6be87ca72 100644 --- a/patches/unapplied/server/0193-WitchThrowPotionEvent.patch +++ b/patches/server/0192-WitchThrowPotionEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java -index 3e070a61a3099601e57d70ec663c4c6fb291c024..c7470a5b95ee25078296c0443630c88a371b8a6f 100644 +index f9cd71379a1d195731e7348ac6928372a4b2c29c..a14e00d55930628333cc63b18727ea56dbdc4ee3 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -229,9 +229,16 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -230,9 +230,16 @@ public class Witch extends Raider implements RangedAttackMob { holder = Potions.WEAKNESS; } diff --git a/patches/unapplied/server/0194-WitchReadyPotionEvent.patch b/patches/server/0193-WitchReadyPotionEvent.patch similarity index 82% rename from patches/unapplied/server/0194-WitchReadyPotionEvent.patch rename to patches/server/0193-WitchReadyPotionEvent.patch index 0e12aa1c8a..12dc123a2c 100644 --- a/patches/unapplied/server/0194-WitchReadyPotionEvent.patch +++ b/patches/server/0193-WitchReadyPotionEvent.patch @@ -5,27 +5,26 @@ Subject: [PATCH] WitchReadyPotionEvent diff --git a/src/main/java/net/minecraft/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java -index c7470a5b95ee25078296c0443630c88a371b8a6f..d286239d02b81624124c4e32ff4413bbac902d54 100644 +index a14e00d55930628333cc63b18727ea56dbdc4ee3..a84f873b27bc3bc1ed3c2769e02a88fec37289fe 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Witch.java +++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java -@@ -150,7 +150,11 @@ public class Witch extends Raider implements RangedAttackMob { +@@ -151,6 +151,11 @@ public class Witch extends Raider implements RangedAttackMob { } if (holder != null) { -- this.setItemSlot(EquipmentSlot.MAINHAND, PotionContents.createItemStack(Items.POTION, holder)); + // Paper start + ItemStack potion = PotionContents.createItemStack(Items.POTION, holder); + potion = org.bukkit.craftbukkit.event.CraftEventFactory.handleWitchReadyPotionEvent(this, potion); + this.setItemSlot(EquipmentSlot.MAINHAND, potion); + // Paper end - this.usingTime = this.getMainHandItem().getUseDuration(); + this.setItemSlot(EquipmentSlot.MAINHAND, PotionContents.createItemStack(Items.POTION, holder)); + this.usingTime = this.getMainHandItem().getUseDuration(this); this.setUsingItem(true); - if (!this.isSilent()) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a49abc180f76cb7aeb6eda86998acd00e9d3fdee..d4c44ff13f657343ec19de5e6cef7639330a5e88 100644 +index 000a95dfd5c83b84fcd973a388a705d9470a4fe0..4e0db83bb6a4529b6e0727ea181bf79e06c2025a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1899,4 +1899,14 @@ public class CraftEventFactory { +@@ -1905,4 +1905,14 @@ public class CraftEventFactory { ).callEvent(); } // Paper end - PlayerUseUnknownEntityEvent diff --git a/patches/unapplied/server/0195-ItemStack-getMaxItemUseDuration.patch b/patches/server/0194-ItemStack-getMaxItemUseDuration.patch similarity index 91% rename from patches/unapplied/server/0195-ItemStack-getMaxItemUseDuration.patch rename to patches/server/0194-ItemStack-getMaxItemUseDuration.patch index ccbf860b91..999f5c771e 100644 --- a/patches/unapplied/server/0195-ItemStack-getMaxItemUseDuration.patch +++ b/patches/server/0194-ItemStack-getMaxItemUseDuration.patch @@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index dac1ff1387462b0125140a37d134d51c5e023bf5..92faa15f79f0541048e29254dcf3560616d3c0e7 100644 +index f3f567bf61e655862fbeea4be87241d6f7f15785..9cf035486cedfc2e3ba522416e8fea3ad01cfec5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -187,6 +187,13 @@ public final class CraftItemStack extends ItemStack { diff --git a/patches/server/0195-Add-EntityTeleportEndGatewayEvent.patch b/patches/server/0195-Add-EntityTeleportEndGatewayEvent.patch new file mode 100644 index 0000000000..223298011a --- /dev/null +++ b/patches/server/0195-Add-EntityTeleportEndGatewayEvent.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sat, 9 Jun 2018 14:08:39 +0200 +Subject: [PATCH] Add EntityTeleportEndGatewayEvent + + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 439e8b4f52ba88456fb8ae5ab960d715f5c0d131..d790aec175e61bd9dd9c14cbbbd4c3c354bf867a 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -3301,8 +3301,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + if (!this.isRemoved()) { + // CraftBukkit start + Location to = new Location(teleportTarget.newLevel().getWorld(), teleportTarget.pos().x, teleportTarget.pos().y, teleportTarget.pos().z, teleportTarget.yRot(), teleportTarget.xRot()); +- EntityTeleportEvent teleEvent = CraftEventFactory.callEntityTeleportEvent(this, to); +- if (teleEvent.isCancelled()) { ++ // Paper start - gateway-specific teleport event ++ final EntityTeleportEvent teleEvent; ++ if (this.portalProcess != null && this.portalProcess.isSamePortal(((net.minecraft.world.level.block.EndGatewayBlock) net.minecraft.world.level.block.Blocks.END_GATEWAY)) && this.level.getBlockEntity(this.portalProcess.getEntryPosition()) instanceof net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity theEndGatewayBlockEntity) { ++ teleEvent = new com.destroystokyo.paper.event.entity.EntityTeleportEndGatewayEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), to, new org.bukkit.craftbukkit.block.CraftEndGateway(to.getWorld(), theEndGatewayBlockEntity)); ++ teleEvent.callEvent(); ++ } else { ++ teleEvent = CraftEventFactory.callEntityTeleportEvent(this, to); ++ } ++ // Paper end - gateway-specific teleport event ++ if (teleEvent.isCancelled() || teleEvent.getTo() == null) { + return null; + } + to = teleEvent.getTo(); diff --git a/patches/unapplied/server/0124-PlayerTeleportEndGatewayEvent.patch b/patches/unapplied/server/0124-PlayerTeleportEndGatewayEvent.patch deleted file mode 100644 index b63f7764ee..0000000000 --- a/patches/unapplied/server/0124-PlayerTeleportEndGatewayEvent.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 31 Dec 2016 21:44:50 -0500 -Subject: [PATCH] PlayerTeleportEndGatewayEvent - -Allows you to access the Gateway being used in a teleport event -Fix the offset used for player teleportation - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -index 45aca9747557a94ac3e60ee9f23c30abb2367bff..9690416c2ffa7d1b7607d21ae0a990dcbcbcddae 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -@@ -202,11 +202,11 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { - // CraftBukkit start - Fire PlayerTeleportEvent/EntityTeleportEvent - if (entity1 instanceof ServerPlayer) { - org.bukkit.craftbukkit.entity.CraftPlayer player = (CraftPlayer) entity1.getBukkitEntity(); -- org.bukkit.Location location = CraftLocation.toBukkit(blockposition1, world.getWorld()).add(0.5D, 0.5D, 0.5D); -+ org.bukkit.Location location = CraftLocation.toBukkit(blockposition1, world.getWorld()).add(0.5D, 0, 0.5D); // Paper - use the right Y offset - location.setPitch(player.getLocation().getPitch()); - location.setYaw(player.getLocation().getYaw()); - -- PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.END_GATEWAY); -+ PlayerTeleportEvent teleEvent = new com.destroystokyo.paper.event.player.PlayerTeleportEndGatewayEvent(player, player.getLocation(), location, new org.bukkit.craftbukkit.block.CraftEndGateway(worldserver.getWorld(), blockEntity)); // Paper - Bukkit.getPluginManager().callEvent(teleEvent); - if (teleEvent.isCancelled()) { - return; diff --git a/patches/unapplied/server/0157-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/patches/unapplied/server/0157-Send-attack-SoundEffects-only-to-players-who-can-see.patch deleted file mode 100644 index cb530598f0..0000000000 --- a/patches/unapplied/server/0157-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Brokkonaut -Date: Tue, 31 Oct 2017 03:26:18 +0100 -Subject: [PATCH] Send attack SoundEffects only to players who can see the - attacker - - -diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index e81acc5c982cd14bc8a3aa5bf06e9636179b8555..c1c0df2f4cf032a004568ab0e8f21db91e9dc705 100644 ---- a/src/main/java/net/minecraft/world/entity/player/Player.java -+++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1243,7 +1243,7 @@ public abstract class Player extends LivingEntity { - - i += EnchantmentHelper.getKnockbackBonus(this); - if (this.isSprinting() && flag) { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - ++i; - flag1 = true; - } -@@ -1318,7 +1318,7 @@ public abstract class Player extends LivingEntity { - } - } - -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_SWEEP, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - this.sweepAttack(); - } - -@@ -1346,15 +1346,15 @@ public abstract class Player extends LivingEntity { - } - - if (flag2) { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_CRIT, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - this.crit(target); - } - - if (!flag2 && !flag3) { - if (flag) { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_STRONG, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - } else { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_WEAK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - } - } - -@@ -1406,7 +1406,7 @@ public abstract class Player extends LivingEntity { - - this.causeFoodExhaustion(this.level().spigotConfig.combatExhaustion, EntityExhaustionEvent.ExhaustionReason.ATTACK); // CraftBukkit - EntityExhaustionEvent // Spigot - Change to use configurable value - } else { -- this.level().playSound((Player) null, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); -+ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_NODAMAGE, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility - if (flag4) { - target.clearFire(); - } -@@ -1812,6 +1812,14 @@ public abstract class Player extends LivingEntity { - public int getXpNeededForNextLevel() { - return this.experienceLevel >= 30 ? 112 + (this.experienceLevel - 30) * 9 : (this.experienceLevel >= 15 ? 37 + (this.experienceLevel - 15) * 5 : 7 + this.experienceLevel * 2); - } -+ // Paper start - send while respecting visibility -+ private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { -+ fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself -+ if (fromEntity instanceof ServerPlayer) { -+ ((ServerPlayer) fromEntity).connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong())); -+ } -+ } -+ // Paper end - send while respecting visibility - - // CraftBukkit start - public void causeFoodExhaustion(float exhaustion) { diff --git a/patches/unapplied/server/0174-Toggleable-player-crits.patch b/patches/unapplied/server/0174-Toggleable-player-crits.patch deleted file mode 100644 index df29b0135d..0000000000 --- a/patches/unapplied/server/0174-Toggleable-player-crits.patch +++ /dev/null @@ -1,18 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: MiniDigger -Date: Sat, 10 Mar 2018 00:50:24 +0100 -Subject: [PATCH] Toggleable player crits - - -diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index c1c0df2f4cf032a004568ab0e8f21db91e9dc705..715a66018afa8d67f6e078e1157886390a2ad5dd 100644 ---- a/src/main/java/net/minecraft/world/entity/player/Player.java -+++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -1251,6 +1251,7 @@ public abstract class Player extends LivingEntity { - f += this.getItemInHand(InteractionHand.MAIN_HAND).getItem().getAttackDamageBonus(this, f); - boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround() && !this.onClimbable() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && target instanceof LivingEntity && !this.isSprinting(); - -+ flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits - if (flag2) { - f *= 1.5F; - } diff --git a/patches/unapplied/server/0196-Add-EntityTeleportEndGatewayEvent.patch b/patches/unapplied/server/0196-Add-EntityTeleportEndGatewayEvent.patch deleted file mode 100644 index c43c6a3b23..0000000000 --- a/patches/unapplied/server/0196-Add-EntityTeleportEndGatewayEvent.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Sat, 9 Jun 2018 14:08:39 +0200 -Subject: [PATCH] Add EntityTeleportEndGatewayEvent - - -diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -index 9690416c2ffa7d1b7607d21ae0a990dcbcbcddae..f8053b42fbf144d427cc4ed44b3b735358c58a20 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java -@@ -219,8 +219,14 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity { - - } - -- org.bukkit.event.entity.EntityTeleportEvent teleEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTeleportEvent(entity1, blockposition1.getX() + 0.5, blockposition1.getY() + 0.5, blockposition1.getZ() + 0.5); -- if (teleEvent.isCancelled()) { -+ // Paper start - EntityTeleportEndGatewayEvent -+ org.bukkit.Location location = new org.bukkit.Location(world.getWorld(), blockposition1.getX() + 0.5D, blockposition1.getY(), blockposition1.getZ() + 0.5D); -+ location.setPitch(entity1.getXRot()); -+ location.setYaw(entity1.getBukkitYaw()); -+ org.bukkit.entity.Entity bukkitEntity = entity1.getBukkitEntity(); -+ org.bukkit.event.entity.EntityTeleportEvent teleEvent = new com.destroystokyo.paper.event.entity.EntityTeleportEndGatewayEvent(bukkitEntity, bukkitEntity.getLocation(), location, new org.bukkit.craftbukkit.block.CraftEndGateway(world.getWorld(), blockEntity)); -+ if (!teleEvent.callEvent() || teleEvent.getTo() == null) { -+ // Paper end - EntityTeleportEndGatewayEvent - return; - } -