mirror of
https://github.com/PurpurMC/Purpur.git
synced 2025-02-23 13:09:31 +08:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@7f47b9b Remove KeyedObject interface (#7680) PaperMC/Paper@7bf9446 Add per player chunk loading limits PaperMC/Paper@04c7b16 Undeprecate Material#isLegacy (#7679)
61 lines
3.7 KiB
Diff
61 lines
3.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: BillyGalbreath <blake.galbreath@gmail.com>
|
|
Date: Tue, 28 Dec 2021 10:11:31 -0600
|
|
Subject: [PATCH] Option to prevent spiders from climbing world border
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index f09f233c2005b600feffee27237ce01c6207b255..d58de23619321fadad3755f6110954ac462bbba1 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -243,6 +243,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
public boolean verticalCollision;
|
|
public boolean verticalCollisionBelow;
|
|
public boolean minorHorizontalCollision;
|
|
+ public boolean collidingWithWorldBorder; // Purpur
|
|
public boolean hurtMarked;
|
|
protected Vec3 stuckSpeedMultiplier;
|
|
@Nullable
|
|
@@ -1334,7 +1335,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
io.papermc.paper.util.CollisionUtil.getCollisions(world, this, collisionBox, potentialCollisions, false, true,
|
|
false, false, null, null);
|
|
|
|
- if (io.papermc.paper.util.CollisionUtil.isCollidingWithBorderEdge(world.getWorldBorder(), collisionBox)) {
|
|
+ if (this.collidingWithWorldBorder = io.papermc.paper.util.CollisionUtil.isCollidingWithBorderEdge(world.getWorldBorder(), collisionBox)) { // Purpur
|
|
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
|
|
index 177f9fe0d0a10e5d3644805751f2050fe984fde7..07dc3b10a275895f23fcf50720ef25faea358c58 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
|
|
@@ -118,7 +118,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.purpurConfig.spiderCanClimbWorldBorder || !this.collidingWithWorldBorder)); // Purpur
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index d28424cc74068904f0a3479789307f9529b03efa..b7edb6045624efa24929ab3d3b583b5237e7015c 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -2462,6 +2462,7 @@ public class PurpurWorldConfig {
|
|
public double spiderMaxHealth = 16.0D;
|
|
public boolean spiderTakeDamageFromWater = false;
|
|
public boolean spiderAlwaysDropExp = false;
|
|
+ public boolean spiderCanClimbWorldBorder = true;
|
|
private void spiderSettings() {
|
|
spiderRidable = getBoolean("mobs.spider.ridable", spiderRidable);
|
|
spiderRidableInWater = getBoolean("mobs.spider.ridable-in-water", spiderRidableInWater);
|
|
@@ -2474,6 +2475,7 @@ public class PurpurWorldConfig {
|
|
spiderMaxHealth = getDouble("mobs.spider.attributes.max_health", spiderMaxHealth);
|
|
spiderTakeDamageFromWater = getBoolean("mobs.spider.takes-damage-from-water", spiderTakeDamageFromWater);
|
|
spiderAlwaysDropExp = getBoolean("mobs.spider.always-drop-exp", spiderAlwaysDropExp);
|
|
+ spiderCanClimbWorldBorder = getBoolean("mobs.spider.can-climb-world-border", spiderCanClimbWorldBorder);
|
|
}
|
|
|
|
public boolean strayRidable = false;
|