geforkt von Mirrors/Paper
18c3716c49
This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. We also store counts by type to further enable other performance optimizations in later patches.
31 Zeilen
1.2 KiB
Diff
31 Zeilen
1.2 KiB
Diff
From 3f31cdecde77021afea54370f1fb31ef0621b59f Mon Sep 17 00:00:00 2001
|
|
From: Zach Brown <zach.brown@destroystokyo.com>
|
|
Date: Thu, 14 Apr 2016 17:48:56 -0500
|
|
Subject: [PATCH] Water mobs should only spawn in the water
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWaterAnimal.java b/src/main/java/net/minecraft/server/EntityWaterAnimal.java
|
|
index f430bdeec..0597edad6 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWaterAnimal.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWaterAnimal.java
|
|
@@ -11,7 +11,15 @@ public abstract class EntityWaterAnimal extends EntityInsentient implements IAni
|
|
}
|
|
|
|
public boolean P() {
|
|
- return true;
|
|
+ // Paper start - Don't let water mobs spawn in non-water blocks
|
|
+ // Based around EntityAnimal's implementation
|
|
+ int i = MathHelper.floor(this.locX);
|
|
+ int j = MathHelper.floor(this.getBoundingBox().b); // minY of bounding box
|
|
+ int k = MathHelper.floor(this.locZ);
|
|
+ Block block = this.world.getType(new BlockPosition(i, j, k)).getBlock();
|
|
+
|
|
+ return block == Blocks.WATER || block == Blocks.FLOWING_WATER;
|
|
+ // Paper end
|
|
}
|
|
|
|
public boolean canSpawn() {
|
|
--
|
|
2.18.0
|
|
|