2019-07-20 12:01:24 +08:00
From 57b5375c57af7f8abc4f1071d3a284a8a0f07e5f Mon Sep 17 00:00:00 2001
2018-08-27 15:01:09 +08: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
2019-07-20 12:01:24 +08:00
index ae4dd98ee1..bcb7276308 100644
2018-08-27 15:01:09 +08:00
--- a/src/main/java/net/minecraft/server/EntityCreeper.java
+++ b/src/main/java/net/minecraft/server/EntityCreeper.java
2019-07-05 10:13:38 +08:00
@@ -14,7 +14,7 @@ public class EntityCreeper extends EntityMonster {
2019-05-05 16:33:44 +08:00
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 static final DataWatcherObject<Boolean> isIgnitedDW = d; // Paper OBFHELPER
private int bz;
2018-08-27 15:01:09 +08:00
- private int fuseTicks;
+ public int fuseTicks; // Paper - public
public int maxFuseTicks = 30;
public int explosionRadius = 3;
2019-05-05 16:33:44 +08:00
private int bD;
2019-07-05 10:13:38 +08:00
@@ -254,7 +254,18 @@ public class EntityCreeper extends EntityMonster {
2018-08-27 15:01:09 +08:00
}
2019-06-25 09:47:58 +08:00
public void ignite() {
- this.datawatcher.set(EntityCreeper.d, true);
+ // Paper start
+ setIgnited(true);
+ }
+
2018-08-27 15:01:09 +08:00
+ public void setIgnited(boolean ignited) {
2018-10-08 00:58:09 +08: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()) {
2019-05-05 16:33:44 +08:00
+ this.datawatcher.set(EntityCreeper.d, event.isIgnited());
2018-10-08 00:58:09 +08:00
+ }
+ }
2018-08-27 15:01:09 +08:00
+ // 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
2019-07-20 12:01:24 +08:00
index 896405148c..075a5e77e2 100644
2018-08-27 15:01:09 +08:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
2019-06-19 19:55:03 +08:00
@@ -88,4 +88,18 @@ public class CraftCreeper extends CraftMonster implements Creeper {
2018-08-27 15:01:09 +08:00
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;
+ }
+ // Paper end
}
--
2019-06-19 19:55:03 +08:00
2.22.0
2018-08-27 15:01:09 +08:00