2016-12-17 04:13:45 +00:00
|
|
|
From 7ea77c7bbcea4714f13d0aaed96d3ca96fc56bac Mon Sep 17 00:00:00 2001
|
2016-04-14 22:49:11 +00:00
|
|
|
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
|
2016-11-17 02:23:38 +00:00
|
|
|
index 90d33af..2515557 100644
|
2016-04-14 22:49:11 +00:00
|
|
|
--- 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
|
|
|
|
}
|
|
|
|
|
2016-11-17 02:23:38 +00:00
|
|
|
public boolean cM() {
|
2016-04-14 22:49:11 +00:00
|
|
|
- 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);
|
2016-04-15 20:49:39 +00:00
|
|
|
+ Block block = this.world.getType(new BlockPosition(i, j, k)).getBlock();
|
2016-04-14 22:49:11 +00:00
|
|
|
+
|
2016-04-15 20:49:39 +00:00
|
|
|
+ return block == Blocks.WATER || block == Blocks.FLOWING_WATER;
|
2016-04-14 22:49:11 +00:00
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean canSpawn() {
|
|
|
|
--
|
2016-12-10 23:50:31 +00:00
|
|
|
2.9.3
|
2016-04-14 22:49:11 +00:00
|
|
|
|