SPIGOT-5061: Add explode and ignite methods to Creeper

This commit is contained in:
i509VCB 2019-06-14 17:21:29 -05:00 committed by md_5
parent f2757f95b3
commit 8003ced585
2 changed files with 17 additions and 1 deletions

View file

@ -32,7 +32,13 @@
@Override @Override
protected boolean a(EntityHuman entityhuman, EnumHand enumhand) { protected boolean a(EntityHuman entityhuman, EnumHand enumhand) {
ItemStack itemstack = entityhuman.b(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; Explosion.Effect explosion_effect = this.world.getGameRules().getBoolean("mobGriefing") ? Explosion.Effect.DESTROY : Explosion.Effect.NONE;
float f = this.isPowered() ? 2.0F : 1.0F; float f = this.isPowered() ? 2.0F : 1.0F;

View file

@ -64,6 +64,16 @@ public class CraftCreeper extends CraftMonster implements Creeper {
return getHandle().explosionRadius; return getHandle().explosionRadius;
} }
@Override
public void explode() {
getHandle().eb();
}
@Override
public void ignite() {
getHandle().dY(); // PAIL rename ignite
}
@Override @Override
public EntityCreeper getHandle() { public EntityCreeper getHandle() {
return (EntityCreeper) entity; return (EntityCreeper) entity;