More improvements to activation range, improve turtles

improved the water code so that immunity wont trigger if the entity
has the water pathfinder system active, so this improves support
for all entities that know how to behave in water.

Merged 2 EAR patches together, and removed an MCUtil method that
doesnt have a purpose anymore
This commit is contained in:
Aikar
2018-10-04 23:18:46 -04:00
parent c4cbda699b
commit bdd77afa95
47 changed files with 247 additions and 295 deletions

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] MC Utils
diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java
index 6ffc535146..5ed34cf7e3 100644
index 6ffc535146..5c5f19b4b4 100644
--- a/src/main/java/net/minecraft/server/BlockPosition.java
+++ b/src/main/java/net/minecraft/server/BlockPosition.java
@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger;
@@ -25,6 +25,14 @@ index 6ffc535146..5ed34cf7e3 100644
public BlockPosition a(int ix, int jx, int kx) {
return ix == 0 && jx == 0 && kx == 0 ? this : new BlockPosition(this.getX() + ix, this.getY() + jx, this.getZ() + kx);
}
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
};
}
+ public BlockPosition asImmutable() { return h(); } // Paper - OBFHELPER
public BlockPosition h() {
return this;
}
@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition {
return this.d;
}
@@ -292,7 +300,7 @@ index c54275bc2f..318c4204df 100644
}
diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java
new file mode 100644
index 0000000000..faec947224
index 0000000000..c97e116aaf
--- /dev/null
+++ b/src/main/java/net/minecraft/server/MCUtil.java
@@ -0,0 +0,0 @@
@@ -552,30 +560,6 @@ index 0000000000..faec947224
+ }
+
+ /**
+ * Gets a chunk without changing its boolean for should unload
+ * @param world
+ * @param x
+ * @param z
+ * @return
+ */
+ @Nullable
+ public static Chunk getLoadedChunkWithoutMarkingActive(World world, int x, int z) {
+ return ((ChunkProviderServer) world.chunkProvider).chunks.get(ChunkCoordIntPair.a(x, z));
+ }
+
+ /**
+ * Gets a chunk without changing its boolean for should unload
+ * @param provider
+ * @param x
+ * @param z
+ * @return
+ */
+ @Nullable
+ public static Chunk getLoadedChunkWithoutMarkingActive(IChunkProvider provider, int x, int z) {
+ return ((ChunkProviderServer)provider).chunks.get(ChunkCoordIntPair.a(x, z));
+ }
+
+ /**
+ * Posts a task to be executed asynchronously
+ * @param run
+ */