2014-08-31 18:56:05 +00:00
|
|
|
From 324451287f5331413823a6e2ffe14e9d8c3cbbec 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-07-30 08:35:19 +00:00
|
|
|
index aba3748..22aac7b 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
|
|
|
|
@@ -2,6 +2,7 @@ package net.minecraft.server;
|
|
|
|
|
|
|
|
public class EntityOcelot extends EntityTameableAnimal {
|
|
|
|
|
|
|
|
+ public boolean spawnBonus = true; // Spigot
|
|
|
|
private PathfinderGoalTempt bq;
|
|
|
|
|
|
|
|
public EntityOcelot(World world) {
|
2014-07-30 08:35:19 +00:00
|
|
|
@@ -213,7 +214,7 @@ public class EntityOcelot extends EntityTameableAnimal {
|
2014-07-21 20:46:54 +00:00
|
|
|
|
|
|
|
public GroupDataEntity prepare(GroupDataEntity groupdataentity) {
|
|
|
|
groupdataentity = super.prepare(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
|
2014-08-18 15:43:17 +00:00
|
|
|
index 92f7188..ea786ae 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
|
|
|
|
@@ -1056,6 +1056,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((GroupDataEntity) null);
|
|
|
|
}
|
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|