3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/Spigot-Server-Patches/0130-Water-mobs-should-only-spawn-in-the-water.patch

31 Zeilen
1.2 KiB
Diff

From 6aac550ebf2a897af86f4bbc51447b5a23fe7d0b 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
2016-06-09 05:57:14 +02:00
index 76394a3..e61f9a2 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
}
2016-06-09 05:57:14 +02:00
public boolean cK() {
- 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() {
--
2016-06-23 04:18:41 +02:00
2.9.0