mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00
47 lines
2.2 KiB
Diff
47 lines
2.2 KiB
Diff
From 6eedfc08d15b73556c08f293adfb8f22108bc631 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 a9963031f..af1ff9518 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
@@ -9,6 +9,7 @@ public class EntityOcelot extends EntityAnimal {
|
|
private static final DataWatcherObject<Boolean> bA = DataWatcher.a(EntityOcelot.class, DataWatcherRegistry.i);
|
|
private EntityOcelot.a<EntityHuman> bB;
|
|
private EntityOcelot.b bD;
|
|
+ public boolean spawnBonus = true; // Spigot
|
|
|
|
public EntityOcelot(EntityTypes<? extends EntityOcelot> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
@@ -227,7 +228,7 @@ public class EntityOcelot extends EntityAnimal {
|
|
@Override
|
|
public GroupDataEntity prepare(GeneratorAccess generatoraccess, DifficultyDamageScaler difficultydamagescaler, EnumMobSpawn enummobspawn, @Nullable GroupDataEntity groupdataentity, @Nullable NBTTagCompound nbttagcompound) {
|
|
groupdataentity = super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, groupdataentity, nbttagcompound);
|
|
- if (generatoraccess.getRandom().nextInt(7) == 0) {
|
|
+ if (spawnBonus && generatoraccess.getRandom().nextInt(7) == 0) { // Spigot
|
|
this.dW();
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index cf12b4b55..90b87bb01 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -1529,6 +1529,12 @@ public class CraftWorld implements World {
|
|
}
|
|
|
|
if (entity != null) {
|
|
+ // Spigot start
|
|
+ if (entity instanceof net.minecraft.server.EntityOcelot)
|
|
+ {
|
|
+ ( (net.minecraft.server.EntityOcelot) entity ).spawnBonus = false;
|
|
+ }
|
|
+ // Spigot end
|
|
return entity;
|
|
}
|
|
|
|
--
|
|
2.20.1
|
|
|