From 5c6d9448aa5bf7b1eaf8817382d43486a91a6a8c Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sat, 19 Jul 2014 12:49:48 +0100 Subject: [PATCH] Don't spawn bonus ocelots when plugins spawn ocelots diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java index 9d09404..7ae68bb 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -6,6 +6,7 @@ public class EntityOcelot extends EntityTameableAnimal { private PathfinderGoalAvoidTarget bm; private PathfinderGoalTempt bn; + public boolean spawnBonus = true; // Spigot public EntityOcelot(World world) { super(world); @@ -226,7 +227,7 @@ public class EntityOcelot extends EntityTameableAnimal { public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, GroupDataEntity groupdataentity) { groupdataentity = super.prepare(difficultydamagescaler, groupdataentity); - if (this.world.random.nextInt(7) == 0) { + if (spawnBonus && this.world.random.nextInt(7) == 0) { // Spigot for (int i = 0; i < 2; ++i) { EntityOcelot entityocelot = new EntityOcelot(this.world); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 2322a96..ffa7e24 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1071,6 +1071,12 @@ public class CraftWorld implements World { } if (entity != null) { + // Spigot start + if (entity instanceof EntityOcelot) + { + ( (EntityOcelot) entity ).spawnBonus = false; + } + // Spigot end if (entity instanceof EntityInsentient) { ((EntityInsentient) entity).prepare(getHandle().E(new BlockPosition(entity)), (GroupDataEntity) null); } -- 1.9.1