2018-12-08 10:09:55 +00:00
From 900acad38a9935f66e793d3bc95f209d873a59d5 Mon Sep 17 00:00:00 2001
2018-08-27 07:01:09 +00:00
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 24 Aug 2018 11:50:26 -0500
Subject: [PATCH] Add More Creeper API
diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java
2018-12-08 10:09:55 +00:00
index 569248abb..b1752d66f 100644
2018-08-27 07:01:09 +00:00
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
@@ -14,7 +14,7 @@ public class EntityCreeper extends EntityMonster {
private static final DataWatcherObject<Boolean> b = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);
private static final DataWatcherObject<Boolean> c = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i);private static final DataWatcherObject<Boolean> isIgnitedDW = c; // Paper OBFHELPER
private int bC;
- private int fuseTicks;
+ public int fuseTicks; // Paper - public
public int maxFuseTicks = 30;
public int explosionRadius = 3;
private int bG;
2018-10-07 16:58:09 +00:00
@@ -190,6 +190,7 @@ public class EntityCreeper extends EntityMonster {
2018-08-27 07:01:09 +00:00
return super.a(entityhuman, enumhand);
}
+ public void explode() { this.dE(); } // Paper - OBFHELPER
private void dE() {
if (!this.world.isClientSide) {
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
2018-10-07 16:58:09 +00:00
@@ -241,8 +242,19 @@ public class EntityCreeper extends EntityMonster {
2018-12-08 10:09:55 +00:00
return (Boolean) this.datawatcher.get(EntityCreeper.c);
2018-08-27 07:01:09 +00:00
}
+ // Paper start
+ public void setIgnited(boolean ignited) {
2018-10-07 16:58:09 +00:00
+ if (isIgnited() != ignited) {
+ com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited);
+ if (event.callEvent()) {
+ this.datawatcher.set(EntityCreeper.c, event.isIgnited());
+ }
+ }
2018-08-27 07:01:09 +00:00
+ }
+
public void dB() {
2018-12-08 10:09:55 +00:00
- this.datawatcher.set(EntityCreeper.c, true);
2018-08-27 07:01:09 +00:00
+ setIgnited(true);
+ // Paper end
}
public boolean canCauseHeadDrop() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
2018-10-07 16:58:09 +00:00
index ffebb54ca..ab2b20a0d 100644
2018-08-27 07:01:09 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
@@ -76,4 +76,22 @@ public class CraftCreeper extends CraftMonster implements Creeper {
public EntityType getType() {
return EntityType.CREEPER;
}
+
+ // Paper start
+ public void setIgnited(boolean ignited) {
+ getHandle().setIgnited(ignited);
+ }
+
+ public boolean isIgnited() {
+ return getHandle().isIgnited();
+ }
+
+ public int getFuseTicks() {
+ return getHandle().fuseTicks;
+ }
+
+ public void explode() {
+ getHandle().explode();
+ }
+ // Paper end
}
--
2018-12-08 10:09:55 +00:00
2.19.2
2018-08-27 07:01:09 +00:00