From 13a23951d7142c3c4c39bd5e9bddac190b90c151 Mon Sep 17 00:00:00 2001 From: Tamion <70228790+notTamion@users.noreply.github.com> Date: Sun, 15 Sep 2024 22:26:23 +0200 Subject: [PATCH] Fix enable-player-collisions playing sounds when set to false (#11390) --- .../server/0088-Configurable-Player-Collision.patch | 13 +++++++++++++ ...imbing-should-not-bypass-cramming-gamerule.patch | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/patches/server/0088-Configurable-Player-Collision.patch b/patches/server/0088-Configurable-Player-Collision.patch index 719e6bb654..81cdbc69c4 100644 --- a/patches/server/0088-Configurable-Player-Collision.patch +++ b/patches/server/0088-Configurable-Player-Collision.patch @@ -99,3 +99,16 @@ index 8a91a44e46a2d49e2f4b9e9970c2b77f2e87767e..98862db2334508ee1a783aeabfb14675 } // CraftBukkit start +diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java +index 3207166061bf9c4d7bf3f38e5a9f7aff23ccd5c1..f7014bf5faae03a04c31cbdaeb27188c47156c2d 100644 +--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java ++++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java +@@ -51,7 +51,7 @@ public final class EntitySelector { + return (Predicate) (scoreboardteambase_enumteampush == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : EntitySelector.NO_SPECTATORS.and((entity1) -> { + if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API + return false; +- } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { ++ } else if (entity1 instanceof Player && entity instanceof Player && !io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions) { // Paper - Configurable player collision + return false; + } else { + PlayerTeam scoreboardteam1 = entity1.getTeam(); diff --git a/patches/server/0439-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0439-Climbing-should-not-bypass-cramming-gamerule.patch index d6564a3749..bf6771889d 100644 --- a/patches/server/0439-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0439-Climbing-should-not-bypass-cramming-gamerule.patch @@ -22,7 +22,7 @@ index 6ab665efcac4c2543bab9d95472026e0ec8580c5..dae7643897b47dba304cbea56112445d } diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java -index ee4495b67c46cf1282cdd6ad15b224b0b7b10bfb..e382a29b441b656f35bc24cb90f95cb4def433d2 100644 +index eb425fac573881f3aad09ae75a32184fb0e325a6..302decdccd37c5579473c8fc33adda3956be7603 100644 --- a/src/main/java/net/minecraft/world/entity/EntitySelector.java +++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java @@ -46,11 +46,16 @@ public final class EntitySelector { @@ -41,7 +41,7 @@ index ee4495b67c46cf1282cdd6ad15b224b0b7b10bfb..e382a29b441b656f35bc24cb90f95cb4 - if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API + if (!entity1.isCollidable(ignoreClimbing) || !entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API // Paper - Climbing should not bypass cramming gamerule return false; - } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { + } else if (entity1 instanceof Player && entity instanceof Player && !io.papermc.paper.configuration.GlobalConfiguration.get().collisions.enablePlayerCollisions) { // Paper - Configurable player collision return false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java index c9ef71184cdf73ca275331a5b99902426c5df436..40b86b9b25135e55cc01e502dbc8cc22344efa5d 100644