mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
b742f7a892
Upstream merge (we must go deeper) SpigotMC/Spigot@1e7bc383c3
45 lines
No EOL
2 KiB
Diff
45 lines
No EOL
2 KiB
Diff
From 0000000000000000000000000000000000000000 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityOcelot.java
|
|
@@ -0,0 +0,0 @@ package net.minecraft.server;
|
|
|
|
public class EntityOcelot extends EntityTameableAnimal {
|
|
|
|
+ public boolean spawnBonus = true; // Spigot
|
|
private PathfinderGoalTempt bq;
|
|
|
|
public EntityOcelot(World world) {
|
|
@@ -0,0 +0,0 @@ public class EntityOcelot extends EntityTameableAnimal {
|
|
|
|
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
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
@@ -0,0 +0,0 @@ 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);
|
|
}
|
|
--
|