mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-12 06:58:11 +02:00
48 lines
2.0 KiB
Diff
48 lines
2.0 KiB
Diff
From 3016caecffd01b7e9372034bd7a917eb19219ee1 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 84c8721..ea5adbe 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<EntityHuman> bo;
|
|
private PathfinderGoalTempt bp;
|
|
+ public boolean spawnBonus = true; // Spigot
|
|
|
|
public EntityOcelot(World world) {
|
|
super(world);
|
|
@@ -230,7 +231,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 f0bafba..d381fd7 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -1096,6 +1096,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
|
|
|