mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 01:01:58 +01:00
SPIGOT-6417: Add Creeper fuse ticks API
By: md_5 <git@md-5.net>
This commit is contained in:
parent
07037838f1
commit
9fe10a5da5
@ -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) {
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user