Files
Purpur/patches/server/0242-Option-to-prevent-spiders-from-climbing-world-border.patch
Krakenied fff2015d52 Updated Upstream (Paper) (#1174)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@7b3b593 [ci skip] Update checkout action in workflow (#8510)
PaperMC/Paper@36869cc Fix new block data in EntityChangeBlockEvent for silverfish when mobGriefing isn't enabled (#8099)
PaperMC/Paper@2432233 Add allow server listing & text filtering client options (#7595)
PaperMC/Paper@954e6f0 Fix a bunch more forceDrops for dropping items (#8095)
PaperMC/Paper@32d95e9 Track projectile source for fireworks from dispensers (#8044)
PaperMC/Paper@0249750 Fix EntityArgument suggestion permissions to align with EntitySelector#checkPermissions (#8511)
PaperMC/Paper@8acb05d Make CommandSyntaxException implement ComponentMessageThrowable (#8513)
PaperMC/Paper@c264018 [ci skip] Undo modification to removed patches in latest commit (#8512)
PaperMC/Paper@304ab35 [ci skip] Remove old todo file
PaperMC/Paper@8a4b752 Fix wrong descriptor in ASMEventExecutorGenerator (#8506)
PaperMC/Paper@b743144 Fix MC-147659 (#8423)
PaperMC/Paper@aaf5e39 Deprecate unused VehicleEntityCollisionEvent methods (#8498)
2022-10-29 22:47:43 -07:00

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 333cb9aaf281822ed47443d54a27fe2fc438cd21..f9cf68820e01619a4ec319f18583a24115bfe112 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -304,6 +304,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
@@ -1416,7 +1417,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
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 (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 bdd4fc3072f7a5ea504ba35f6a08ae971e83b69f..b9ac8cefefe1f47548166330b7c889dfbc05e583 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 229b4c97f2b05660a5564e4d3ee114495e056535..026dcf93405f70e5249bff9bd574aa195903e706 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -2458,6 +2458,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);
@@ -2470,6 +2471,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;