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:b33b63908eSupport complex components in written book builder (#6337)bfb3d42b44Optimize entity tracker passenger checks (#6361)399710ff79Add reobf mappings patch for MinecraftServer#getLootTables (#6368)25cd8aba9fConfig option for Piglins guarding chests (#4829)80650e8936Added EntityItemDamageEvent (#4928) Tuinity Changes:8e7cc4dc96Do not submit profile lookups to worldgen threads
40 lines
3.1 KiB
Diff
40 lines
3.1 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 60605a8a021cc56f9c3ba22bc43c43c302fb1a70..e7dc64c3ef715e3e58d79bb55546a1222c101edf 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 (blockPathTypes != BlockPathTypes.WALKABLE && (!this.isAmphibious() || blockPathTypes != BlockPathTypes.WATER)) {
|
|
- if ((node == null || node.costMalus < 0.0F) && maxYStep > 0 && blockPathTypes != BlockPathTypes.FENCE && blockPathTypes != BlockPathTypes.UNPASSABLE_RAIL && blockPathTypes != BlockPathTypes.TRAPDOOR && blockPathTypes != BlockPathTypes.POWDER_SNOW) {
|
|
+ if ((node == null || node.costMalus < 0.0F) && maxYStep > 0 && blockPathTypes != BlockPathTypes.FENCE && !(!this.mob.level.purpurConfig.mobsIgnoreRails && blockPathTypes == BlockPathTypes.UNPASSABLE_RAIL) && blockPathTypes != BlockPathTypes.TRAPDOOR && blockPathTypes != BlockPathTypes.POWDER_SNOW) { // Purpur
|
|
node = this.findAcceptedNode(x, y + 1, z, maxYStep - 1, prevFeetY, direction, nodeType);
|
|
if (node != null && (node.type == BlockPathTypes.OPEN || node.type == BlockPathTypes.WALKABLE) && this.mob.getBbWidth() < 1.0F) {
|
|
double g = (double)(x - direction.getStepX()) + 0.5D;
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index fe13c25efe4c3696f20771f1bbdf256c56934a24..57c5e7c77079a214ce7fde850fe198005b2297cd 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -642,6 +642,7 @@ public class PurpurWorldConfig {
|
|
public double voidDamageDealt = 4.0D;
|
|
public int raidCooldownSeconds = 0;
|
|
public int animalBreedingCooldownSeconds = 0;
|
|
+ public boolean mobsIgnoreRails = false;
|
|
private void miscGameplayMechanicsSettings() {
|
|
useBetterMending = getBoolean("gameplay-mechanics.use-better-mending", useBetterMending);
|
|
alwaysTameInCreative = getBoolean("gameplay-mechanics.always-tame-in-creative", alwaysTameInCreative);
|
|
@@ -664,6 +665,7 @@ public class PurpurWorldConfig {
|
|
voidDamageDealt = getDouble("gameplay-mechanics.void-damage-dealt", voidDamageDealt);
|
|
raidCooldownSeconds = getInt("gameplay-mechanics.raid-cooldown-seconds", raidCooldownSeconds);
|
|
animalBreedingCooldownSeconds = getInt("gameplay-mechanics.animal-breeding-cooldown-seconds", animalBreedingCooldownSeconds);
|
|
+ mobsIgnoreRails = getBoolean("gameplay-mechanics.mobs-ignore-rails", mobsIgnoreRails);
|
|
}
|
|
|
|
public Set<Block> noRandomTickBlocks = new HashSet<>();
|