PaperSpigot-Parent/CraftBukkit-Patches/0137-Don-t-spawn-bonus-ocelots-when-plugins-spawn-ocelots.patch
Zach Brown 19972e09b8 Update SpigotMC's patches
5a0150f586ed3eb15fe6f1f596d1a5a7d806f0f9 Fix ITEM_BREAK
e6a3911057bd94d8bd7021cbb4923fb84fb106d1 Upstream merge
d1cdcf8d4c3639f956474f02ed662517cffbe23e Remove old patch
068df64aeee368377e1673667bffc7a6dcf90554 Rebuild all patches
2014-11-30 16:16:48 -06:00

48 lines
2.0 KiB
Diff

From 383992b4386c2ade3121e49027abe147bae13914 Mon Sep 17 00:00:00 2001
From: Thinkofdeath <thinkofdeath@spigotmc.org>
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 50fdfcd..d5ea292 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -1066,6 +1066,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);
}
--
2.1.0