From 2eeed9e6fac23ed64f74c1a7723dc2ab4a8f1827 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 23 Apr 2024 14:31:37 -0700 Subject: [PATCH] 41 --- ...ient-crashes-server-lists-and-Mojang.patch | 17 ++++----- .../0038-Implement-Paper-VersionChecker.patch | 4 +-- ...d-version-history-to-version-command.patch | 4 +-- .../0040-Player-affects-spawning-API.patch | 36 +++++++++---------- ...041-Only-refresh-abilities-if-needed.patch | 4 +-- 5 files changed, 33 insertions(+), 32 deletions(-) rename patches/{unapplied => }/server/0037-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch (89%) rename patches/{unapplied => }/server/0038-Implement-Paper-VersionChecker.patch (97%) rename patches/{unapplied => }/server/0039-Add-version-history-to-version-command.patch (98%) rename patches/{unapplied => }/server/0040-Player-affects-spawning-API.patch (85%) rename patches/{unapplied => }/server/0041-Only-refresh-abilities-if-needed.patch (87%) diff --git a/patches/unapplied/server/0037-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0037-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch similarity index 89% rename from patches/unapplied/server/0037-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch rename to patches/server/0037-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 92105de031..17ed919612 100644 --- a/patches/unapplied/server/0037-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0037-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c1f9acad1e97915dfad5fbc0ba2547853e3b37f1..01a1d2af6b4cf66cff8eb6d14116343a121deed2 100644 +index cf9ce8a8e7d576d91e9d745e9c45f698100808bd..de18627c6f09ef911c9cb6d6aec9a5f3bfe5a72b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1615,7 +1615,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop withinDistance(double x, double y, double z, double max) { double d4 = max * max; diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 1ab169b362cc18d2467e5ed6a4af325d7f6dd247..2de1ad28d42d4beec69901bf985ac0be582f00b9 100644 +index 9dcd90b8e027075ccec0902bd1b13f82f6fe1bcd..14d1222286c7387eca828a9380053f14e4539b3c 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java -@@ -850,7 +850,7 @@ public abstract class Mob extends LivingEntity implements Targeting { +@@ -904,7 +904,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti if (this.level().getDifficulty() == Difficulty.PEACEFUL && this.shouldDespawnInPeaceful()) { this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause } else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) { @@ -34,10 +34,10 @@ index 1ab169b362cc18d2467e5ed6a4af325d7f6dd247..2de1ad28d42d4beec69901bf985ac0be if (entityhuman != null) { double d0 = entityhuman.distanceToSqr((Entity) this); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java -index c7ab59aa0e2fd0f3e7252647ddb25b82ac604830..8f20239f3ef7ebe41fac8ee6e024c36dafec33c4 100644 +index c01d9751828d03f37f36b52d84336bd0ee008e8b..f3a02925833733ae50d706ffc681dd05344a7687 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/SkeletonTrapGoal.java -@@ -25,7 +25,7 @@ public class SkeletonTrapGoal extends Goal { +@@ -27,7 +27,7 @@ public class SkeletonTrapGoal extends Goal { @Override public boolean canUse() { @@ -47,10 +47,10 @@ index c7ab59aa0e2fd0f3e7252647ddb25b82ac604830..8f20239f3ef7ebe41fac8ee6e024c36d @Override diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java -index 38fb2a14b7c7c535f5a0b13d698a2521ca9d0c1a..0e2725d92002c181f542e2335cdd6e6de69155e1 100644 +index 95e9d38dbccbd1c43ababd707e18dfe6779256c1..9ff42b0ae2b82dc3092e38e1439d89b4ab554b17 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java +++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java -@@ -128,7 +128,7 @@ public class Silverfish extends Monster { +@@ -118,7 +118,7 @@ public class Silverfish extends Monster { if (checkAnyLightMonsterSpawnRules(type, world, spawnReason, pos, random)) { Player entityhuman = world.getNearestPlayer((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D, 5.0D, true); @@ -60,35 +60,35 @@ index 38fb2a14b7c7c535f5a0b13d698a2521ca9d0c1a..0e2725d92002c181f542e2335cdd6e6d return false; } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index a779d32f87b59f347408974e402fad22fdc47f09..15ccde8ee8bac1f70c6047464595aff6db073646 100644 +index 767b8f4db39db9a3732282536b52ae1cb077b503..1226abd6ce7bb13942a0583c721835aeb769bbb6 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -326,7 +326,7 @@ public class Zombie extends Monster { +@@ -322,7 +322,7 @@ public class Zombie extends Monster { - if (NaturalSpawner.isSpawnPositionOk(entitypositiontypes_surface, this.level(), blockposition, entitytypes) && SpawnPlacements.checkSpawnRules(entitytypes, worldserver, MobSpawnType.REINFORCEMENT, blockposition, this.level().random)) { + if (SpawnPlacements.isSpawnPositionOk(entitytypes, this.level(), blockposition) && SpawnPlacements.checkSpawnRules(entitytypes, worldserver, MobSpawnType.REINFORCEMENT, blockposition, this.level().random)) { entityzombie.setPos((double) i1, (double) j1, (double) k1); - if (!this.level().hasNearbyAlivePlayer((double) i1, (double) j1, (double) k1, 7.0D) && this.level().isUnobstructed(entityzombie) && this.level().noCollision((Entity) entityzombie) && !this.level().containsAnyLiquid(entityzombie.getBoundingBox())) { + if (!this.level().hasNearbyAlivePlayerThatAffectsSpawning((double) i1, (double) j1, (double) k1, 7.0D) && this.level().isUnobstructed(entityzombie) && this.level().noCollision((Entity) entityzombie) && !this.level().containsAnyLiquid(entityzombie.getBoundingBox())) { // Paper - Affects Spawning API entityzombie.setTarget(entityliving, EntityTargetEvent.TargetReason.REINFORCEMENT_TARGET, true); // CraftBukkit - entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null, (CompoundTag) null); + entityzombie.finalizeSpawn(worldserver, this.level().getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.REINFORCEMENT, (SpawnGroupData) null); worldserver.addFreshEntityWithPassengers(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit 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 1ac22d4cbab0f385b1c1e0b4ced59ca7c3ca4af4..0cd534ddc28758f7fa6203c66505f167ecbdd3de 100644 +index da52fdde1a17c230b4da2c58708fa69ebcf13431..81db0e4e4bced556d35978a10c9d9789ec527830 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -181,6 +181,7 @@ public abstract class Player extends LivingEntity { +@@ -193,6 +193,7 @@ public abstract class Player extends LivingEntity { @Nullable - public FishingHook fishing; - protected float hurtDir; + public Entity currentExplosionCause; + public boolean ignoreFallDamageFromCurrentImpulse; + public boolean affectsSpawning = true; // Paper - Affects Spawning API // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index d156f7e3430685947d2b4c30aa867e8002ca70ad..e888cf862662ae6baa6d0de8188aa74a9c6a8e00 100644 +index cc54da2987fafcbd69153c33033a6f272dd3be66..418e29971326008ebca0cc4b696a41a49c1c7bb7 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java -@@ -56,7 +56,7 @@ public abstract class BaseSpawner { +@@ -58,7 +58,7 @@ public abstract class BaseSpawner { } public boolean isNearPlayer(Level world, BlockPos pos) { @@ -135,10 +135,10 @@ index f38f62e777d88a783e1e3b7e1a48da921cc67cf4..77ae7882a08441d9a80b50492be5e484 for (Player player : this.players()) { if (EntitySelector.NO_SPECTATORS.test(player) && EntitySelector.LIVING_ENTITY_STILL_ALIVE.test(player)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2da161b901189c3dcf90c95a074b8c2cbf30f282..e1510cb7cb1406bebed1804b8c18086425cb7d94 100644 +index 14f86623be9f27b4c2507a33e0bddce50c7eccf4..c468ab9d4749d2c8bd70b7ecfc7412ce50021946 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2340,6 +2340,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2408,6 +2408,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().language; } diff --git a/patches/unapplied/server/0041-Only-refresh-abilities-if-needed.patch b/patches/server/0041-Only-refresh-abilities-if-needed.patch similarity index 87% rename from patches/unapplied/server/0041-Only-refresh-abilities-if-needed.patch rename to patches/server/0041-Only-refresh-abilities-if-needed.patch index 59271ed1e6..21244d222f 100644 --- a/patches/unapplied/server/0041-Only-refresh-abilities-if-needed.patch +++ b/patches/server/0041-Only-refresh-abilities-if-needed.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index e1510cb7cb1406bebed1804b8c18086425cb7d94..4655d1c493651779c2038776e4d6fef23c7e7b43 100644 +index c468ab9d4749d2c8bd70b7ecfc7412ce50021946..6f4d287d8a6992af475e8c94f4316d091d76f921 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2012,12 +2012,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2081,12 +2081,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) {