From 3dd6ba54e56416e066eb13c92dfbd5f7b83d2ee3 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 5515a30b7..4e132eabb 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -10,6 +10,7 @@ public class EntityOcelot extends EntityTameableAnimal { private static final MinecraftKey bI = new MinecraftKey("cat"); private PathfinderGoalAvoidTarget bJ; private PathfinderGoalTempt bK; + public boolean spawnBonus = true; // Spigot public EntityOcelot(World world) { super(EntityTypes.OCELOT, world); @@ -234,7 +235,7 @@ public class EntityOcelot extends EntityTameableAnimal { @Nullable public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) { groupdataentity = super.prepare(difficultydamagescaler, groupdataentity, nbttagcompound); - if (this.getCatType() == 0 && this.world.random.nextInt(7) == 0) { + if (spawnBonus && this.getCatType() == 0 && 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 5dcfe744a..29a5ac639 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1207,6 +1207,12 @@ public class CraftWorld implements World { } if (entity != null) { + // Spigot start + if (entity instanceof EntityOcelot) + { + ( (EntityOcelot) entity ).spawnBonus = false; + } + // Spigot end return entity; } -- 2.17.1