geforkt von Mirrors/Paper
1e38743b1d
Also fixes build as a result of an upstream force push --- work/Bukkit Submodule work/Bukkit 217dc08d..d13fdf8c: > SPIGOT-4637: Add source block to BlockPhysicsEvent. --- work/CraftBukkit Submodule work/CraftBukkit acbba8ba..cb98c6ea: > Fix line endings in CraftDefaultPermissions > SPIGOT-4637: Add source block to BlockPhysicsEvent. --- work/Spigot Submodule work/Spigot 75ee78a0c...4165cd8f4 (commits not present) > (Manually Added) - Appears to be a result of an upstream force push > (Manually Added) - Changed: SPIGOT-4636: Add creative mode NBT permissions
79 Zeilen
2.9 KiB
Diff
79 Zeilen
2.9 KiB
Diff
From c0a4ea7a94c6b7cee9784046eb7677af3ab1e383 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index a07337ae4..945a75dd6 100644
|
|
--- 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;
|
|
@@ -190,6 +190,7 @@ public class EntityCreeper extends EntityMonster {
|
|
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");
|
|
@@ -241,8 +242,19 @@ public class EntityCreeper extends EntityMonster {
|
|
return (Boolean) this.datawatcher.get(EntityCreeper.c);
|
|
}
|
|
|
|
+ // Paper start
|
|
+ public void setIgnited(boolean ignited) {
|
|
+ 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());
|
|
+ }
|
|
+ }
|
|
+ }
|
|
+
|
|
public void dB() {
|
|
- this.datawatcher.set(EntityCreeper.c, true);
|
|
+ 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
|
|
index ffebb54ca..ab2b20a0d 100644
|
|
--- 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
|
|
}
|
|
--
|
|
2.20.1
|
|
|