aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0900-Add-config-option-for-spider-worldborder-climbing.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0900-Add-config-option-for-spider-worldborder-climbing.patch')
-rw-r--r--patches/server/0900-Add-config-option-for-spider-worldborder-climbing.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patches/server/0900-Add-config-option-for-spider-worldborder-climbing.patch b/patches/server/0900-Add-config-option-for-spider-worldborder-climbing.patch
new file mode 100644
index 0000000000..3eaf67b54a
--- /dev/null
+++ b/patches/server/0900-Add-config-option-for-spider-worldborder-climbing.patch
@@ -0,0 +1,40 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: BillyGalbreath <[email protected]>
+Date: Thu, 27 Oct 2022 15:35:47 +0200
+Subject: [PATCH] Add config option for spider worldborder climbing
+
+
+diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
+index 83d9487f20f42b678682ccb53b5e20c5932a579f..077f786a00b3954f39194eb645d84f9c083ef8fc 100644
+--- a/src/main/java/net/minecraft/world/entity/Entity.java
++++ b/src/main/java/net/minecraft/world/entity/Entity.java
+@@ -403,6 +403,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
+ @javax.annotation.Nullable
+ private UUID originWorld;
+ public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
++ public boolean collidingWithWorldBorder; // Paper
+
+ public void setOrigin(@javax.annotation.Nonnull Location location) {
+ this.origin = location.toVector();
+@@ -1476,7 +1477,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
+ null, null
+ );
+
+- if (io.papermc.paper.util.CollisionUtil.isCollidingWithBorderEdge(world.getWorldBorder(), collisionBox)) {
++ if (collidingWithWorldBorder = io.papermc.paper.util.CollisionUtil.isCollidingWithBorderEdge(world.getWorldBorder(), collisionBox)) { // Paper - this line *is* correct, ignore the IDE warning about assignments being used as a condition
+ potentialCollisionsVoxel.add(world.getWorldBorder().getCollisionShape());
+ }
+
+diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
+index 9e5d68fe86d17118df3d6a1c36b296f32b4d7fc1..71b5a9c97a13f703073c0122742ff9e8a0e49df2 100644
+--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
++++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
+@@ -86,7 +86,7 @@ public class Spider extends Monster {
+ public void tick() {
+ super.tick();
+ if (!this.level().isClientSide) {
+- this.setClimbing(this.horizontalCollision);
++ this.setClimbing(this.horizontalCollision && (this.level().paperConfig().entities.behavior.allowSpiderWorldBorderClimbing || !collidingWithWorldBorder)); // Paper
+ }
+
+ }