SPIGOT-6417: Add Creeper fuse ticks API

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2021-04-11 17:32:26 +10:00
parent 07037838f1
commit 9fe10a5da5
2 changed files with 22 additions and 1 deletions

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/world/entity/monster/EntityCreeper.java
+++ b/net/minecraft/world/entity/monster/EntityCreeper.java
@@ -38,6 +38,12 @@
@@ -38,13 +38,19 @@
import net.minecraft.world.level.IMaterial;
import net.minecraft.world.level.World;
@ -13,6 +13,14 @@
public class EntityCreeper extends EntityMonster {
private static final DataWatcherObject<Integer> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
private int bo;
- private int fuseTicks;
+ public int fuseTicks; // PAIL
public int maxFuseTicks = 30;
public int explosionRadius = 3;
private int bs;
@@ -200,9 +206,19 @@
@Override
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {

View File

@ -52,6 +52,19 @@ public class CraftCreeper extends CraftMonster implements Creeper {
return getHandle().maxFuseTicks;
}
@Override
public void setFuseTicks(int ticks) {
Preconditions.checkArgument(ticks >= 0, "ticks < 0");
Preconditions.checkArgument(ticks <= getMaxFuseTicks(), "ticks > maxFuseTicks");
getHandle().fuseTicks = ticks;
}
@Override
public int getFuseTicks() {
return getHandle().fuseTicks;
}
@Override
public void setExplosionRadius(int radius) {
Preconditions.checkArgument(radius >= 0, "radius < 0");