summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityCreeper.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-05-31 20:53:37 +1000
committermd_5 <git@md-5.net>2016-05-31 20:53:37 +1000
commit5ae53e0d5c8eca530137364681ee37825f8a3f25 (patch)
treefc6d000940bcc22a9039b87ddf20976647c77455 /nms-patches/EntityCreeper.patch
parent71e5248c8b97a6345a367543bdb8a85477baf81b (diff)
downloadcraftbukkit-5ae53e0d5c8eca530137364681ee37825f8a3f25.tar
craftbukkit-5ae53e0d5c8eca530137364681ee37825f8a3f25.tar.gz
craftbukkit-5ae53e0d5c8eca530137364681ee37825f8a3f25.tar.lz
craftbukkit-5ae53e0d5c8eca530137364681ee37825f8a3f25.tar.xz
craftbukkit-5ae53e0d5c8eca530137364681ee37825f8a3f25.zip
SPIGOT-2335: EntityCreeper.setPowered
Diffstat (limited to 'nms-patches/EntityCreeper.patch')
-rw-r--r--nms-patches/EntityCreeper.patch14
1 files changed, 8 insertions, 6 deletions
diff --git a/nms-patches/EntityCreeper.patch b/nms-patches/EntityCreeper.patch
index 72fa1d23..2de4eedc 100644
--- a/nms-patches/EntityCreeper.patch
+++ b/nms-patches/EntityCreeper.patch
@@ -28,25 +28,27 @@
}
-@@ -158,8 +163,18 @@
+@@ -158,9 +163,19 @@
public void onLightningStrike(EntityLightning entitylightning) {
super.onLightningStrike(entitylightning);
+- this.datawatcher.set(EntityCreeper.b, Boolean.valueOf(true));
+ // CraftBukkit start
+ if (CraftEventFactory.callCreeperPowerEvent(this, entitylightning, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) {
+ return;
+ }
+
+ this.setPowered(true);
-+ }
-+
-+ public void setPowered(boolean powered) {
- this.datawatcher.set(EntityCreeper.b, Boolean.valueOf(true));
}
-+ // CraftBukkit end
++ public void setPowered(boolean powered) {
++ this.datawatcher.set(EntityCreeper.b, powered);
++ }
++ // CraftBukkit end
++
protected boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
if (itemstack != null && itemstack.getItem() == Items.FLINT_AND_STEEL) {
+ this.world.a(entityhuman, this.locX, this.locY, this.locZ, SoundEffects.bx, this.bA(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
@@ -180,9 +195,17 @@
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
float f = this.isPowered() ? 2.0F : 1.0F;