testserver/CraftBukkit-Patches/0131-Don-t-spawn-bonus-ocel...

48 lines
1.9 KiB
Diff
Raw Normal View History

2015-07-10 12:33:16 +00:00
From 9d49fee2e7d303f46d087ad0e983d1c468e895e3 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
2015-05-09 20:23:26 +00:00
index 2121438..edcb307 100644
--- 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 {
2015-02-28 11:36:22 +00:00
private PathfinderGoalAvoidTarget<EntityHuman> bo;
private PathfinderGoalTempt bp;
+ public boolean spawnBonus = true; // Spigot
public EntityOcelot(World world) {
2014-11-28 01:17:45 +00:00
super(world);
2015-02-28 11:36:22 +00:00
@@ -230,7 +231,7 @@ public class EntityOcelot extends EntityTameableAnimal {
2014-11-28 01:17:45 +00:00
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
2015-07-10 12:33:16 +00:00
index d7b122f..c1d552a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2015-07-10 12:33:16 +00:00
@@ -1106,6 +1106,12 @@ public class CraftWorld implements World {
}
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;
}
--
2015-05-09 20:23:26 +00:00
2.1.4