From 8003ced5859ea173429b8efa8fb9b7b3de7f5d2e Mon Sep 17 00:00:00 2001 From: i509VCB Date: Fri, 14 Jun 2019 17:21:29 -0500 Subject: [PATCH] SPIGOT-5061: Add explode and ignite methods to Creeper --- nms-patches/EntityCreeper.patch | 8 +++++++- .../org/bukkit/craftbukkit/entity/CraftCreeper.java | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/nms-patches/EntityCreeper.patch b/nms-patches/EntityCreeper.patch index 68389534d2..1d479faf7f 100644 --- a/nms-patches/EntityCreeper.patch +++ b/nms-patches/EntityCreeper.patch @@ -32,7 +32,13 @@ @Override protected boolean a(EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); -@@ -192,10 +206,18 @@ +@@ -187,15 +201,23 @@ + return super.a(entityhuman, enumhand); + } + +- private void eb() { ++ public void eb() { // PAIL rename explode, private -> public + if (!this.world.isClientSide) { Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean("mobGriefing") ? Explosion.Effect.DESTROY : Explosion.Effect.NONE; float f = this.isPowered() ? 2.0F : 1.0F; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java index 796ee9e40d..95b3a7acc9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java @@ -64,6 +64,16 @@ public class CraftCreeper extends CraftMonster implements Creeper { return getHandle().explosionRadius; } + @Override + public void explode() { + getHandle().eb(); + } + + @Override + public void ignite() { + getHandle().dY(); // PAIL rename ignite + } + @Override public EntityCreeper getHandle() { return (EntityCreeper) entity;