Files
Purpur/patches/server/0197-Config-to-allow-mobs-to-pathfind-over-rails.patch
granny c6802b0a27 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@9f1fa0b Fix item gravity on inactive items, remove dumb active skipping
PaperMC/Paper@1a1d0cf Use target pitch in teleport (generally the same thing)
PaperMC/Paper@8ba3073 fix "is_freezing" damage type tag
PaperMC/Paper@1523212 don't resend effects when PlayerItemConsumeEvent is cancelled
PaperMC/Paper@1330880 Add Friction API to minecarts
PaperMC/Paper@580a610 Allow using old ender pearl behavior & apply ender pearl exploit patch (#11524)
PaperMC/Paper@40a960d Rebuild patches
PaperMC/Paper@dfedf79 Correctly cancel consumption of consumable
PaperMC/Paper@147b796 get previous redstone level from the right state for experimental wires
PaperMC/Paper@ad9c58e Only expose velocity relative tp flags to API (#11532)
PaperMC/Paper@f273e6e Set updatingMinecraft to false
PaperMC/Paper@c5c1250 [ci skip] Remove leftover todo file (#11540)
PaperMC/Paper@7ee4835 Correctly clear  explosion density cache(#11541)
PaperMC/Paper@52a0590 Updated Upstream (Bukkit/CraftBukkit) (#11543)
PaperMC/Paper@5c0930d Fix fix recipe iterator patch
PaperMC/Paper@1de0130 re-add a dispense fix patch
PaperMC/Paper@16d7d73 bunch more general fixes
PaperMC/Paper@a5d7426 Correctly support RecipeChoice.empty (#11550)
PaperMC/Paper@85c870e Correct update cursor (#11554)
PaperMC/Paper@d19be64 Fix NPE with spark when CraftServer is not init yet (#11558)
PaperMC/Paper@92131ad Decrease dead entity teleport warning (#11559)
2024-11-01 18:25:48 -07:00

40 lines
2.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Encode42 <me@encode42.dev>
Date: Sun, 8 Aug 2021 22:50:23 -0400
Subject: [PATCH] Config to allow mobs to pathfind over rails
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
index c84fd369d92932903c76bb2012602617d3e2d213..f6291ff377b38cb84692a9fd564b4b1a9780cf4f 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
@@ -240,7 +240,7 @@ public class WalkNodeEvaluator extends NodeEvaluator {
if ((node == null || node.costMalus < 0.0F)
&& maxYStep > 0
&& (pathType != PathType.FENCE || this.canWalkOverFences())
- && pathType != PathType.UNPASSABLE_RAIL
+ && (this.mob.level().purpurConfig.mobsIgnoreRails || pathType != PathType.UNPASSABLE_RAIL) // Purpur
&& pathType != PathType.TRAPDOOR
&& pathType != PathType.POWDER_SNOW) {
node = this.tryJumpOn(x, y, z, maxYStep, prevFeetY, direction, nodeType, mutableBlockPos);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 87374995aef0061ffbd64a1ee7a88e21935e6759..8392bed4344d6880b2e2a00e42e12b705095b3cd 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -139,6 +139,7 @@ public class PurpurWorldConfig {
public boolean imposeTeleportRestrictionsOnEndPortals = false;
public boolean tickFluids = true;
public double mobsBlindnessMultiplier = 1;
+ public boolean mobsIgnoreRails = false;
private void miscGameplayMechanicsSettings() {
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
@@ -160,6 +161,7 @@ public class PurpurWorldConfig {
imposeTeleportRestrictionsOnEndPortals = getBoolean("gameplay-mechanics.impose-teleport-restrictions-on-end-portals", imposeTeleportRestrictionsOnEndPortals);
tickFluids = getBoolean("gameplay-mechanics.tick-fluids", tickFluids);
mobsBlindnessMultiplier = getDouble("gameplay-mechanics.entity-blindness-multiplier", mobsBlindnessMultiplier);
+ mobsIgnoreRails = getBoolean("gameplay-mechanics.mobs-ignore-rails", mobsIgnoreRails);
}
public int daytimeTicks = 12000;