diff options
author | md_5 <git@md-5.net> | 2018-11-14 14:17:25 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-11-14 14:17:25 +1100 |
commit | c2035aa1d045bfa22fde511c50283b2494cca00e (patch) | |
tree | 233fd8747ad1199ba6aff749c91a7c56ab064965 | |
parent | d2c422f13e5226a81b7fe3f8355922beed2a9cfc (diff) | |
download | craftbukkit-c2035aa1d045bfa22fde511c50283b2494cca00e.tar craftbukkit-c2035aa1d045bfa22fde511c50283b2494cca00e.tar.gz craftbukkit-c2035aa1d045bfa22fde511c50283b2494cca00e.tar.lz craftbukkit-c2035aa1d045bfa22fde511c50283b2494cca00e.tar.xz craftbukkit-c2035aa1d045bfa22fde511c50283b2494cca00e.zip |
Add some missing CreatureSpawnEvent.SpawnReason calls
-rw-r--r-- | nms-patches/EntityMushroomCow.patch | 6 | ||||
-rw-r--r-- | nms-patches/EntityVillager.patch | 6 | ||||
-rw-r--r-- | nms-patches/Village.patch | 7 |
3 files changed, 14 insertions, 5 deletions
diff --git a/nms-patches/EntityMushroomCow.patch b/nms-patches/EntityMushroomCow.patch index e39e2781..3c07a016 100644 --- a/nms-patches/EntityMushroomCow.patch +++ b/nms-patches/EntityMushroomCow.patch @@ -28,15 +28,17 @@ this.world.addParticle(Particles.u, this.locX, this.locY + (double) (this.length / 2.0F), this.locZ, 0.0D, 0.0D, 0.0D); if (!this.world.isClientSide) { this.die(); -@@ -35,6 +49,11 @@ +@@ -35,7 +49,12 @@ entitycow.setCustomName(this.getCustomName()); } +- this.world.addEntity(entitycow); + // CraftBukkit start + if (CraftEventFactory.callEntityTransformEvent(this, entitycow, EntityTransformEvent.TransformReason.SHEARED).isCancelled()) { + return false; + } ++ this.world.addEntity(entitycow, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED); + // CraftBukkit end - this.world.addEntity(entitycow); for (int i = 0; i < 5; ++i) { + this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.length, this.locZ, new ItemStack(Blocks.RED_MUSHROOM))); diff --git a/nms-patches/EntityVillager.patch b/nms-patches/EntityVillager.patch index 7d9705c9..515d8695 100644 --- a/nms-patches/EntityVillager.patch +++ b/nms-patches/EntityVillager.patch @@ -73,15 +73,17 @@ } } -@@ -574,6 +604,11 @@ +@@ -574,7 +604,12 @@ entitywitch.setCustomNameVisible(this.getCustomNameVisible()); } +- this.world.addEntity(entitywitch); + // CraftBukkit start + if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) { + return; + } ++ this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); + // CraftBukkit end - this.world.addEntity(entitywitch); this.die(); } + } diff --git a/nms-patches/Village.patch b/nms-patches/Village.patch index 930b4047..bb8a0c6f 100644 --- a/nms-patches/Village.patch +++ b/nms-patches/Village.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/Village.java +++ b/net/minecraft/server/Village.java -@@ -73,7 +73,7 @@ +@@ -73,11 +73,11 @@ BlockPosition blockposition1 = blockposition.a(this.a.random.nextInt(16) - 8, this.a.random.nextInt(6) - 3, this.a.random.nextInt(16) - 8); if (this.a(blockposition1)) { @@ -9,3 +9,8 @@ if (entityirongolem != null) { if (entityirongolem.a((GeneratorAccess) this.a, false) && entityirongolem.a((IWorldReader) this.a)) { +- this.a.addEntity(entityirongolem); ++ this.a.addEntity(entityirongolem, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.VILLAGE_DEFENSE); // CraftBukkit + return entityirongolem; + } + |