2016-02-29 21:33:06 +00:00
|
|
|
From c4fe74ae25ea8a0bf39d876df16b3703f3809301 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00:00
|
|
|
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
|
2016-02-29 21:33:06 +00:00
|
|
|
index 06ace47..f74d1b9 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityOcelot.java
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -7,6 +7,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
|
|
|
private static final DataWatcherObject<Integer> bz = DataWatcher.a(EntityOcelot.class, DataWatcherRegistry.b);
|
|
|
|
private PathfinderGoalAvoidTarget<EntityHuman> bA;
|
|
|
|
private PathfinderGoalTempt bB;
|
2014-07-21 20:46:54 +00:00
|
|
|
+ public boolean spawnBonus = true; // Spigot
|
|
|
|
|
|
|
|
public EntityOcelot(World world) {
|
2014-11-28 01:17:45 +00:00
|
|
|
super(world);
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -229,7 +230,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
2014-07-21 20:46:54 +00:00
|
|
|
|
2014-11-28 01:17:45 +00:00
|
|
|
public GroupDataEntity prepare(DifficultyDamageScaler difficultydamagescaler, GroupDataEntity groupdataentity) {
|
|
|
|
groupdataentity = super.prepare(difficultydamagescaler, groupdataentity);
|
2014-07-21 20:46:54 +00:00
|
|
|
- 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
|
2016-02-29 21:33:06 +00:00
|
|
|
index 2b3569d..c0d7ac5 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2016-02-29 21:33:06 +00:00
|
|
|
@@ -1107,6 +1107,12 @@ public class CraftWorld implements World {
|
2014-07-21 20:46:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (entity != null) {
|
|
|
|
+ // Spigot start
|
|
|
|
+ if (entity instanceof EntityOcelot)
|
|
|
|
+ {
|
|
|
|
+ ( (EntityOcelot) entity ).spawnBonus = false;
|
|
|
|
+ }
|
|
|
|
+ // Spigot end
|
2015-06-20 23:24:26 +00:00
|
|
|
return entity;
|
|
|
|
}
|
|
|
|
|
2014-07-21 20:46:54 +00:00
|
|
|
--
|
2016-02-29 21:33:06 +00:00
|
|
|
2.5.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|