summaryrefslogtreecommitdiffstats
path: root/nms-patches/ItemMonsterEgg.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-03-01 08:32:46 +1100
committermd_5 <git@md-5.net>2016-03-01 09:32:45 +1100
commitaa008dff0f9bedbe88e1fe79831776b0a52eb90a (patch)
treecb520e0f4cc5d683fb9b7fb95de37480a7443dfb /nms-patches/ItemMonsterEgg.patch
parente1ebe524a78e27f6a2829ed4574fded3779094e1 (diff)
downloadcraftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.gz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.lz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.tar.xz
craftbukkit-aa008dff0f9bedbe88e1fe79831776b0a52eb90a.zip
Update to Minecraft 1.9
Diffstat (limited to 'nms-patches/ItemMonsterEgg.patch')
-rw-r--r--nms-patches/ItemMonsterEgg.patch27
1 files changed, 13 insertions, 14 deletions
diff --git a/nms-patches/ItemMonsterEgg.patch b/nms-patches/ItemMonsterEgg.patch
index e4236317..bba43c1f 100644
--- a/nms-patches/ItemMonsterEgg.patch
+++ b/nms-patches/ItemMonsterEgg.patch
@@ -1,29 +1,28 @@
--- a/net/minecraft/server/ItemMonsterEgg.java
+++ b/net/minecraft/server/ItemMonsterEgg.java
-@@ -109,6 +109,12 @@
+@@ -131,6 +131,11 @@
}
- public static Entity a(World world, int i, double d0, double d1, double d2) {
+ public static Entity a(World world, String s, double d0, double d1, double d2) {
+ // CraftBukkit start - delegate to spawnCreature
-+ return spawnCreature(world, i, d0, d1, d2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG);
++ return spawnCreature(world, s, d0, d1, d2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG);
+ }
+
-+ public static Entity spawnCreature(World world, int i, double d0, double d1, double d2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
-+ // CraftBukkit end
- if (!EntityTypes.eggInfo.containsKey(Integer.valueOf(i))) {
- return null;
- } else {
-@@ -123,8 +129,13 @@
- entityinsentient.aK = entityinsentient.yaw;
- entityinsentient.aI = entityinsentient.yaw;
- entityinsentient.prepare(world.E(new BlockPosition(entityinsentient)), (GroupDataEntity) null);
++ public static Entity spawnCreature(World world, String s, double d0, double d1, double d2, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason) {
+ if (s != null && EntityTypes.eggInfo.containsKey(s)) {
+ Entity entity = null;
+
+@@ -143,8 +148,13 @@
+ entityinsentient.aO = entityinsentient.yaw;
+ entityinsentient.aM = entityinsentient.yaw;
+ entityinsentient.prepare(world.D(new BlockPosition(entityinsentient)), (GroupDataEntity) null);
- world.addEntity(entity);
-- entityinsentient.x();
+- entityinsentient.D();
+ // CraftBukkit start - don't return an entity when CreatureSpawnEvent is canceled
+ if (!world.addEntity(entity, spawnReason)) {
+ entity = null;
+ } else {
-+ entityinsentient.x();
++ entityinsentient.D();
+ }
+ // CraftBukkit end
}