diff --git a/nms-patches/EntityCreeper.patch b/nms-patches/EntityCreeper.patch index 5721057fff..580aeb9145 100644 --- a/nms-patches/EntityCreeper.patch +++ b/nms-patches/EntityCreeper.patch @@ -11,6 +11,17 @@ public class EntityCreeper extends EntityMonster { +@@ -11,8 +15,8 @@ + private static final DataWatcherObject c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.h); + private int bx; + private int fuseTicks; +- private int maxFuseTicks = 30; +- private int explosionRadius = 3; ++ public int maxFuseTicks = 30; // PAIL private -> public ++ public int explosionRadius = 3; // PAIL private -> public + private int bB; + + public EntityCreeper(World world) { @@ -125,7 +129,7 @@ } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java index ed771a5b29..ffebb54caa 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; +import com.google.common.base.Preconditions; import net.minecraft.server.EntityCreeper; import org.bukkit.craftbukkit.CraftServer; @@ -38,6 +39,30 @@ public class CraftCreeper extends CraftMonster implements Creeper { } } + @Override + public void setMaxFuseTicks(int ticks) { + Preconditions.checkArgument(ticks >= 0, "ticks < 0"); + + getHandle().maxFuseTicks = ticks; + } + + @Override + public int getMaxFuseTicks() { + return getHandle().maxFuseTicks; + } + + @Override + public void setExplosionRadius(int radius) { + Preconditions.checkArgument(radius >= 0, "radius < 0"); + + getHandle().explosionRadius = radius; + } + + @Override + public int getExplosionRadius() { + return getHandle().explosionRadius; + } + @Override public EntityCreeper getHandle() { return (EntityCreeper) entity;