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-08-14 01:32:51 +02:00
index 6fd0e3556f771464854bd8477163ced7b10b0fc4..c0b23dc9f06655bc8ff447e0960404ce234b9b7e 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-06-09 01:21:20 +02:00
@@ -403,6 +403,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-06-09 01:21:20 +02:00
@@ -1469,7 +1470,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
2022-12-23 17:51:24 +01:00
io.papermc.paper.util.CollisionUtil.getCollisions(world, this, collisionBox, potentialCollisions, false, this.level.paperConfig().chunks.preventMovingIntoUnloadedChunks,
false, false, 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
io.papermc.paper.util.CollisionUtil.addBoxesToIfIntersects(world.getWorldBorder().getCollisionShape(), collisionBox, potentialCollisions);
}
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-06-08 21:35:20 +02:00
index d506091a739b04caf213e8fb0f71b5b78035aa0e..05432184077752b1d0cb764a5e39ed875748b2d6 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
@@ -84,7 +84,7 @@ public class Spider extends Monster {
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
}
}