From 1f6c04c0f4a5fb3b9aa2c0978e9cee1cf504127f Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 6 Apr 2017 21:31:27 +1000 Subject: SPIGOT-3165: Only increment spawncount when mob spawn succeeds --- nms-patches/SpawnerCreature.patch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/nms-patches/SpawnerCreature.patch b/nms-patches/SpawnerCreature.patch index 377f8d79..d8e40847 100644 --- a/nms-patches/SpawnerCreature.patch +++ b/nms-patches/SpawnerCreature.patch @@ -83,16 +83,21 @@ int i2 = blockposition1.getX(); int j2 = blockposition1.getY(); int k2 = blockposition1.getZ(); -@@ -126,7 +159,7 @@ +@@ -125,8 +158,11 @@ + if (entityinsentient.cM() && entityinsentient.canSpawn()) { groupdataentity = entityinsentient.prepare(worldserver.D(new BlockPosition(entityinsentient)), groupdataentity); if (entityinsentient.canSpawn()) { - ++l2; +- ++l2; - worldserver.addEntity(entityinsentient); -+ worldserver.addEntity(entityinsentient, SpawnReason.NATURAL); // CraftBukkit - Added a reason for spawning this creature ++ // CraftBukkit start ++ if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) { ++ ++l2; ++ } ++ // CraftBukkit end } else { entityinsentient.die(); } -@@ -226,8 +259,10 @@ +@@ -226,8 +262,10 @@ } entityinsentient.setPositionRotation((double) ((float) j1 + 0.5F), (double) blockposition.getY(), (double) ((float) k1 + 0.5F), random.nextFloat() * 360.0F, 0.0F); -- cgit v1.2.3