#1428: Expose Creeper igniter

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot 2024-06-19 06:48:33 +10:00
parent e43f607e6a
commit 1128edadb2
2 changed files with 14 additions and 1 deletions

View File

@ -18,7 +18,7 @@
public int maxSwell = 30;
public int explosionRadius = 3;
private int droppedSkulls;
+ private EntityHuman entityIgniter; // CraftBukkit
+ public Entity entityIgniter; // CraftBukkit
public EntityCreeper(EntityTypes<? extends EntityCreeper> entitytypes, World world) {
super(entitytypes, world);

View File

@ -4,6 +4,7 @@ import com.google.common.base.Preconditions;
import net.minecraft.world.entity.monster.EntityCreeper;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity;
import org.bukkit.event.entity.CreeperPowerEvent;
public class CraftCreeper extends CraftMonster implements Creeper {
@ -75,11 +76,23 @@ public class CraftCreeper extends CraftMonster implements Creeper {
getHandle().explodeCreeper();
}
@Override
public void ignite(Entity entity) {
Preconditions.checkNotNull(entity, "entity cannot be null");
getHandle().entityIgniter = ((CraftEntity) entity).getHandle();
getHandle().ignite();
}
@Override
public void ignite() {
getHandle().ignite();
}
@Override
public Entity getIgniter() {
return (getHandle().entityIgniter != null) ? getHandle().entityIgniter.getBukkitEntity() : null;
}
@Override
public EntityCreeper getHandle() {
return (EntityCreeper) entity;