Config to allow mobs to pathfind over rails

This commit is contained in:
Encode42
2025-01-12 12:28:49 -08:00
committed by granny
parent 7f5a06d2b8
commit 504c35afb7
3 changed files with 13 additions and 39 deletions

View File

@@ -0,0 +1,11 @@
--- a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
+++ b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
@@ -240,7 +_,7 @@
if ((node == null || node.costMalus < 0.0F)
&& verticalDeltaLimit > 0
&& (cachedPathType != PathType.FENCE || this.canWalkOverFences())
- && cachedPathType != PathType.UNPASSABLE_RAIL
+ && (this.mob.level().purpurConfig.mobsIgnoreRails || cachedPathType != PathType.UNPASSABLE_RAIL) // Purpur - Config to allow mobs to pathfind over rails
&& cachedPathType != PathType.TRAPDOOR
&& cachedPathType != PathType.POWDER_SNOW) {
node = this.tryJumpOn(x, y, z, verticalDeltaLimit, nodeFloorLevel, direction, pathType, mutableBlockPos);

View File

@@ -138,6 +138,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);
@@ -159,6 +160,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;