mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
0708fa363b
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing CraftBukkit Changes:eb2e6578
SPIGOT-5116: Fix concurrent modification exception inside ChunkMapDistance989f9b3d
SPIGOT-4849: Fix server crash when accessing chunks during chunk load/unload/populate eventsf554183c
SPIGOT-5171: Don't fire PlayerTeleportEvent if not actually moving2349feb8
SPIGOT-5163: Cancelling PlayerBucketFillEvent visually removes the targeted block Spigot Changes: 9a643a6a Remove DataWatcher Locking
65 lines
2.5 KiB
Diff
65 lines
2.5 KiB
Diff
From acaea9bde082e84f983cae5a24bfa96d8b17c16f 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 6be155edc..fd3f53e90 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> 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;
|
|
- private int fuseTicks;
|
|
+ public int fuseTicks; // Paper - public
|
|
public int maxFuseTicks = 30;
|
|
public int explosionRadius = 3;
|
|
private int bD;
|
|
@@ -254,7 +254,18 @@ public class EntityCreeper extends EntityMonster {
|
|
}
|
|
|
|
public void ignite() {
|
|
- this.datawatcher.set(EntityCreeper.d, true);
|
|
+ // Paper start
|
|
+ setIgnited(true);
|
|
+ }
|
|
+
|
|
+ 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.d, event.isIgnited());
|
|
+ }
|
|
+ }
|
|
+ // 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 896405148..075a5e77e 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
|
|
@@ -88,4 +88,18 @@ 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;
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
--
|
|
2.22.0
|
|
|