mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 08:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@b4192fd fix NPE from changes in e4358b82171 PaperMC/Paper@5b6445a Revert "fix NPE from changes in e4358b82171" PaperMC/Paper@323c087 Revert "#686: Fix contains for default section generating real sections" PaperMC/Paper@c837002 Fix client world difficulty sync issue (#7035) PaperMC/Paper@a4782f7 [ci skip] fixup indent PaperMC/Paper@83aee0f [ci skip] Clarify setSize consequences for Slimes (#7036) PaperMC/Paper@7c8fdc1 Add dropped hunk from mid-tick tasks (#7034) PaperMC/Paper@fd263ef Fix empty/null chunk section check in LevelChunk#getBlockData, rename… (#7039) PaperMC/Paper@b8d486c Create workflow to add new PRs to the PR Queue project (#6918) PaperMC/Paper@a50e273 Include axolotls in affected entities for water splash potions (#7024) PaperMC/Paper@af95df8 Port Actually unload POI data from Tuinity 1.16 (#7044) PaperMC/Paper@04897b1 [ci skip] Revert "Create workflow to add new PRs to the PR Queue project (#6918)" (#7046) PaperMC/Paper@b4a77a8 Updated Upstream (Bukkit/CraftBukkit) (#7045) PaperMC/Paper@0e25db2 Fix mis-placed processEnchantOrder from 1.18 update (#7052) PaperMC/Paper@53d026e Fix unused EntitySectionStorage#getEntities(AABB, Consumer) method being broken PaperMC/Paper@772e880 Fix light propagation in high y sections PaperMC/Paper@33ea869 Bump Starlight light version PaperMC/Paper@74fd151 Fix entity equipment on cancellation of EntityDeathEvent (#5740) PaperMC/Paper@758e2a7 Fix bad ticking checks for blocks PaperMC/Paper@0e91b6a Return 0 for light values if a dimenion does not have them PaperMC/Paper@188a8df Fix ChunkSnapshot#isSectionEmpty(int) PaperMC/Paper@bbc7451 Fix issue with snapshotted biomes in last commit PaperMC/Paper@b475c6a Backport log4j fix PaperMC/Paper@4e355c4 Updated Upstream (CraftBukkit) PaperMC/Paper@dce79f3 Update Log4J (#7069)
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 d7bdf3c2a5b99ff7adb3e960ff356a1fad169de0..3ca846cc78ec2ac8c9f840a9ac7f0b87b871f8d7 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/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
index cefa14726dfc69c3d544e92a6373672e09a4c8d3..15b4894d6a4da9cbb8414835f772851675d184f9 100644
|
|
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
|
@@ -654,6 +654,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);
|
|
@@ -675,6 +676,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 boolean anvilAllowColors = false;
|