2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
|
|
Date: Sun, 23 Aug 2020 20:59:00 +0200
|
|
|
|
Subject: [PATCH] Climbing should not bypass cramming gamerule
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
2024-01-14 10:46:04 +01:00
|
|
|
index 4a1245fb3ad821ee997b35f180390a07bc871982..82eb980dd463c423b2b30a3149166a227608bb96 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
2024-01-14 10:46:04 +01:00
|
|
|
@@ -2064,6 +2064,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isPushable() {
|
|
|
|
+ // Paper start
|
|
|
|
+ return isCollidable(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) {
|
|
|
|
+ // Paper end
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntitySelector.java b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
2023-12-06 04:00:14 +01:00
|
|
|
index 68e4440765636295a74ea942862d772d47282ad6..93a41156a01a1638f3ef469b1518a07e7961f378 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntitySelector.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -46,11 +46,16 @@ public final class EntitySelector {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static Predicate<Entity> pushableBy(Entity entity) {
|
|
|
|
+ // Paper start - ignoreClimbing param
|
|
|
|
+ return pushable(entity, false);
|
|
|
|
+ }
|
|
|
|
+ public static Predicate<Entity> pushable(Entity entity, boolean ignoreClimbing) {
|
|
|
|
+ // Paper end
|
2023-12-06 04:00:14 +01:00
|
|
|
PlayerTeam scoreboardteam = entity.getTeam();
|
|
|
|
Team.CollisionRule scoreboardteambase_enumteampush = scoreboardteam == null ? Team.CollisionRule.ALWAYS : scoreboardteam.getCollisionRule();
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
return (Predicate) (scoreboardteambase_enumteampush == Team.CollisionRule.NEVER ? Predicates.alwaysFalse() : EntitySelector.NO_SPECTATORS.and((entity1) -> {
|
2021-06-14 18:58:00 +02:00
|
|
|
- if (!entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API
|
|
|
|
+ if (!entity1.isCollidable(ignoreClimbing) || !entity1.canCollideWithBukkit(entity) || !entity.canCollideWithBukkit(entity1)) { // CraftBukkit - collidable API // Paper - isCollidable
|
2021-06-11 14:02:28 +02:00
|
|
|
return false;
|
2023-06-08 01:56:33 +02:00
|
|
|
} else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) {
|
2021-06-11 14:02:28 +02:00
|
|
|
return false;
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
2024-01-14 10:46:04 +01:00
|
|
|
index 05fe4828af59e3cd894c9979ecb08ad0e1c6b2d3..7d72477cdeaa8238da1291c0a902d090463b95c8 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -3426,7 +3426,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
2022-12-07 21:16:54 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Paper end - don't run getEntities if we're not going to use its result
|
2023-06-08 01:56:33 +02:00
|
|
|
- List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushableBy(this));
|
|
|
|
+ List<Entity> list = this.level().getEntities((Entity) this, this.getBoundingBox(), EntitySelector.pushable(this, this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule)); // Paper - fix climbing bypassing cramming rule
|
2022-12-07 21:16:54 +01:00
|
|
|
|
|
|
|
if (!list.isEmpty()) {
|
|
|
|
// Paper - moved up
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -3616,9 +3616,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
2021-06-14 18:58:00 +02:00
|
|
|
return !this.isRemoved() && this.collides; // CraftBukkit
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
@Override
|
|
|
|
public boolean isPushable() {
|
|
|
|
- return this.isAlive() && !this.isSpectator() && !this.onClimbable() && this.collides; // CraftBukkit
|
2023-06-08 01:56:33 +02:00
|
|
|
+ return this.isCollidable(this.level().paperConfig().collisions.fixClimbingBypassingCrammingRule);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) {
|
|
|
|
+ return this.isAlive() && !this.isSpectator() && (ignoreClimbing || !this.onClimbable()) && this.collides; // CraftBukkit
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
// CraftBukkit start - collidable API
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
2023-12-06 04:00:14 +01:00
|
|
|
index bc9a710a92662b1f69b0f5b289780fe0a0d5ed32..6b614818b14ecfc8fc82b523eeb7e21fdf9bf1ba 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -90,7 +90,7 @@ public class Bat extends AmbientCreature {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
- public boolean isPushable() {
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Parrot.java b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
2023-12-06 04:00:14 +01:00
|
|
|
index fbad0e512b990c3d6885ecf92766ba6fd851cc20..4c34edc55fa0e136ccf49a3aef001f413274dfac 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Parrot.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -383,8 +383,8 @@ public class Parrot extends ShoulderRidingEntity implements VariantHolder<Parrot
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
- public boolean isPushable() {
|
|
|
|
- return super.isPushable(); // CraftBukkit - collidable API
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper
|
|
|
|
+ return super.isCollidable(ignoreClimbing); // CraftBukkit - collidable API // Paper
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
2023-12-06 04:00:14 +01:00
|
|
|
index 6b7453281e32aae20778f26b4098df418401c45b..a13a1725356ca4430f1f0a6d121fc08679de62db 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
2023-09-22 06:40:51 +02:00
|
|
|
@@ -286,7 +286,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
- public boolean isPushable() {
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper
|
|
|
|
return !this.isVehicle();
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
2023-12-06 20:40:37 +01:00
|
|
|
index 4f9afae94a4cbf28a532e889d441c63df50642d9..d46b3b346540cc78cb93f3ce8bc8adc89b3d9b3d 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
|
2023-03-14 21:25:13 +01:00
|
|
|
@@ -343,7 +343,7 @@ public class ArmorStand extends LivingEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
- public boolean isPushable() {
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
2023-12-23 02:44:36 +01:00
|
|
|
index e390735d411d815dcc4591da58db7017452acf31..82ffd50017dc234a9718db551fca0e73a6deded0 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractMinecart.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -172,7 +172,7 @@ public abstract class AbstractMinecart extends VehicleEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
- public boolean isPushable() {
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
2023-12-06 04:00:14 +01:00
|
|
|
index e6a7bf9a27fb66d8c2210678dbe8afa8bbf5e7c8..6b0ec9da5a368775924f5b97c74acc5bfd609fa1 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/vehicle/Boat.java
|
2023-12-06 04:00:14 +01:00
|
|
|
@@ -157,7 +157,7 @@ public class Boat extends VehicleEntity implements VariantHolder<Boat.Type> {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
- public boolean isPushable() {
|
|
|
|
+ public boolean isCollidable(boolean ignoreClimbing) { // Paper
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|