mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 18:07:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@a90092e Updated Upstream (CraftBukkit/Spigot) (#7848) PaperMC/Paper@79e07f3 Fix addPassenger for Marker (#7762) PaperMC/Paper@182a609 Fix duplicate world keys via createWorld (#7614) PaperMC/Paper@b6a6544 Provide ComponentSerializer services (#7527) PaperMC/Paper@3f7fbe3 Fix cb's janky level name in WorldCreator (#7851) PaperMC/Paper@af3b377 Update ForgeFlower (#7857) PaperMC/Paper@9667181 Fix OfflinePlayer#getBedSpawnLocation (#7861) PaperMC/Paper@c123915 Fix FurnaceInventory for smokers and blast furnaces (#7249) PaperMC/Paper@f7382f5 Remove unneeded UOE when copying biome sources (#7629) PaperMC/Paper@6b035fd Update default vanilla command perms (#7386) PaperMC/Paper@f210f67 Update the rewriteForIde for new cb package version (#7242) PaperMC/Paper@3f7111d Fix EntityEquipment and related javadocs (#7380) PaperMC/Paper@78e6431 Add default kick msg component (#6886) PaperMC/Paper@04e1b07 Check HAProxyMessage type is PROXY (#7864) PaperMC/Paper@00c6ae8 Implement Translatable on CreativeCategory (#7587) PaperMC/Paper@7602dd2 Sanitize Sent BlockEntity NBT (#7010) PaperMC/Paper@2d17a50 Add translation keys to GameMode enum (#7081) PaperMC/Paper@c5caee3 Prevent entity loading causing async lookups (#7553) PaperMC/Paper@71fe3c6 Add numeric string completion suggestions as int suggestions (#6360) PaperMC/Paper@b1ac25f Respect x-ray permission in World#refreshChunk (#7214) Pufferfish Changes: pufferfish-gg/Pufferfish@6186c1f Updated Upstream (Paper) pufferfish-gg/Pufferfish@b235d83 Fix regression with SIMD vector sizes not matching 256-bits pufferfish-gg/Pufferfish@27cb1ac Updated Upstream (Paper)
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 82c595515741e3bb75a27a5aabc59136bc2a5937..2908d2882cd6bd97d777a2831995ea7a445843ee 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
|
|
@@ -1335,7 +1336,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;
|