mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Config to allow mobs to pathfind over rails
This commit is contained in:
@@ -1,39 +0,0 @@
|
||||
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/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
index c84fd369d92932903c76bb2012602617d3e2d213..e295fe4aac742ff8942b23456fdce8d7ff944e90 100644
|
||||
--- a/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
|
||||
+++ b/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 - Config to allow mobs to pathfind over rails
|
||||
&& 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 5f97cbbe75ffd6a75cb39db7fc24c61e26068cf8..ff4d9ccbb9801649ad8ea9dac72b0f32f58e06c1 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;
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user