aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0275-Add-More-Creeper-API.patch
blob: faced7350eb782d0008af64d658922f3f4c00122 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
From 0000000000000000000000000000000000000000 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/world/entity/monster/EntityCreeper.java b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
index cbb973e077e04e5221bcc837f434b7093bdbcc2a..b47f71ca1f1c8bbd1a521836d9cb5d676a33ec76 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityCreeper.java
@@ -290,7 +290,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 167b8f0c742be07ee0c5d698e04d6e29addda70c..629518d4bb314a1d46e32397b6fb7b90bce94e83 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java
@@ -101,4 +101,14 @@ 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();
+    }
+    // Paper end
 }