aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0114-Water-mobs-should-only-spawn-in-the-water.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0114-Water-mobs-should-only-spawn-in-the-water.patch')
-rw-r--r--Spigot-Server-Patches/0114-Water-mobs-should-only-spawn-in-the-water.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0114-Water-mobs-should-only-spawn-in-the-water.patch b/Spigot-Server-Patches/0114-Water-mobs-should-only-spawn-in-the-water.patch
new file mode 100644
index 0000000000..f6d10e17d9
--- /dev/null
+++ b/Spigot-Server-Patches/0114-Water-mobs-should-only-spawn-in-the-water.patch
@@ -0,0 +1,30 @@
+From a32a3ff851c3d8ff864c9597bd35a0b43dcb1c34 Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+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 90d33af95..251555713 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 cM() {
+- 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.12.2
+