2022-12-23 17:51:24 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <blake.galbreath@gmail.com>
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
2023-09-23 01:38:10 +02:00
index e68b8d53cacf179050dbc9cbfd815be7159dc8bc..ba9b6bf4ff7c23ca599e09ff2fcbf9ab5d270f5d 100644
2022-12-23 17:51:24 +01:00
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
2023-09-23 01:38:10 +02:00
@@ -402,6 +402,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
2022-12-23 17:51:24 +01:00
@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();
2023-09-23 01:38:10 +02:00
@@ -1443,7 +1444,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
2023-09-23 00:54:36 +02:00
null, null
);
2022-12-23 17:51:24 +01:00
2023-09-23 00:54:36 +02:00
- 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());
}
2022-12-23 17:51:24 +01:00
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
2023-09-22 17:51:48 +02:00
index 9e5d68fe86d17118df3d6a1c36b296f32b4d7fc1..71b5a9c97a13f703073c0122742ff9e8a0e49df2 100644
2022-12-23 17:51:24 +01:00
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
2023-09-22 17:51:48 +02:00
@@ -86,7 +86,7 @@ public class Spider extends Monster {
2022-12-23 17:51:24 +01:00
public void tick() {
super.tick();
2023-06-08 10:47:19 +02:00
if (!this.level().isClientSide) {
2022-12-23 17:51:24 +01:00
- this.setClimbing(this.horizontalCollision);
2023-06-08 10:47:19 +02:00
+ this.setClimbing(this.horizontalCollision && (this.level().paperConfig().entities.behavior.allowSpiderWorldBorderClimbing || !collidingWithWorldBorder)); // Paper
2022-12-23 17:51:24 +01:00
}
}