mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 13:57:35 +01:00
Don't decrement ItemStack when CreatureSpawnEvent is canceled - addresses SPIGOT-87
This commit is contained in:
parent
28f37a113c
commit
55e592e542
@ -1,5 +1,5 @@
|
|||||||
--- ../work/decompile-8eb82bde//net/minecraft/server/ItemMonsterEgg.java 2014-12-03 10:52:09.804159084 +0000
|
--- ../work/decompile-8eb82bde/net/minecraft/server/ItemMonsterEgg.java 2014-12-15 13:53:30.086979118 +0000
|
||||||
+++ src/main/java/net/minecraft/server/ItemMonsterEgg.java 2014-12-03 10:51:53.380159449 +0000
|
+++ src/main/java/net/minecraft/server/ItemMonsterEgg.java 2014-12-15 13:53:30.086979118 +0000
|
||||||
@@ -19,7 +19,8 @@
|
@@ -19,7 +19,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,12 +23,19 @@
|
|||||||
if (!EntityTypes.eggInfo.containsKey(Integer.valueOf(i))) {
|
if (!EntityTypes.eggInfo.containsKey(Integer.valueOf(i))) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
@@ -123,7 +130,7 @@
|
@@ -123,8 +130,13 @@
|
||||||
entityinsentient.aI = entityinsentient.yaw;
|
entityinsentient.aI = entityinsentient.yaw;
|
||||||
entityinsentient.aG = entityinsentient.yaw;
|
entityinsentient.aG = entityinsentient.yaw;
|
||||||
entityinsentient.prepare(world.E(new BlockPosition(entityinsentient)), (GroupDataEntity) null);
|
entityinsentient.prepare(world.E(new BlockPosition(entityinsentient)), (GroupDataEntity) null);
|
||||||
- world.addEntity(entity);
|
- world.addEntity(entity);
|
||||||
+ world.addEntity(entity, spawnReason); // CraftBukkit
|
- entityinsentient.x();
|
||||||
entityinsentient.x();
|
+ // CraftBukkit start - don't return an entity when CreatureSpawnEvent is canceled
|
||||||
|
+ if (!world.addEntity(entity, spawnReason)) {
|
||||||
|
+ entity = null;
|
||||||
|
+ } else {
|
||||||
|
+ entityinsentient.x();
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user