diff options
author | MiniDigger <[email protected]> | 2020-06-25 16:09:55 +0200 |
---|---|---|
committer | MiniDigger <[email protected]> | 2020-06-25 20:41:40 +0200 |
commit | 03a53a63b68a0d3f11f39ba58a1c0496a50a4940 (patch) | |
tree | 52759b5e4fce28c942e23d39d54dce9b3b43f22c /Spigot-Server-Patches/0281-Add-More-Creeper-API.patch | |
parent | 8ac3123f9fa1e6a89fe880194adb4b18effa7fae (diff) | |
download | Paper-03a53a63b68a0d3f11f39ba58a1c0496a50a4940.tar.gz Paper-03a53a63b68a0d3f11f39ba58a1c0496a50a4940.zip |
even even even more work
Diffstat (limited to 'Spigot-Server-Patches/0281-Add-More-Creeper-API.patch')
-rw-r--r-- | Spigot-Server-Patches/0281-Add-More-Creeper-API.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch b/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch new file mode 100644 index 0000000000..e6f7752c89 --- /dev/null +++ b/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath <[email protected]> +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 e4c1a7c152b2c1202c77e5d5d1c386d84007bc97..5e7f3af37b7cb068183fc2a7637b4c770fd5f936 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 bv; +- private int fuseTicks; ++ public int fuseTicks; // Paper - public + public int maxFuseTicks = 30; + public int explosionRadius = 3; + private int bz; +@@ -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 896405148c489011e4f06c43fe961045b7426377..075a5e77e2c2a873b048b9886d630e71238988da 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 + } |