2014-12-18 23:33:08 +00:00
|
|
|
From dce54a9f0bae980bea110133f6f6acc8470bdc58 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
|
2014-12-11 04:21:51 +00:00
|
|
|
index a6b72d8..0f5d09b 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
|
2014-11-28 01:17:45 +00:00
|
|
|
@@ -6,6 +6,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
2014-07-21 20:46:54 +00:00
|
|
|
|
2014-11-28 01:17:45 +00:00
|
|
|
private PathfinderGoalAvoidTarget bm;
|
|
|
|
private PathfinderGoalTempt bn;
|
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);
|
2014-12-11 04:21:51 +00:00
|
|
|
@@ -231,7 +232,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
|
2014-12-18 23:33:08 +00:00
|
|
|
index bb4cb9d..c6ef0fd 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
|
2014-12-18 23:33:08 +00:00
|
|
|
@@ -1086,6 +1086,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
|
|
|
|
if (entity instanceof EntityInsentient) {
|
2014-11-28 01:17:45 +00:00
|
|
|
((EntityInsentient) entity).prepare(getHandle().E(new BlockPosition(entity)), (GroupDataEntity) null);
|
2014-07-21 20:46:54 +00:00
|
|
|
}
|
|
|
|
--
|
2014-12-11 04:21:51 +00:00
|
|
|
2.1.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|