mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-28 09:17:21 +01:00
SPIGOT-2335: EntityCreeper.setPowered
This commit is contained in:
parent
71e5248c8b
commit
5ae53e0d5c
1 changed files with 8 additions and 6 deletions
|
@ -28,25 +28,27 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,8 +163,18 @@
|
@@ -158,9 +163,19 @@
|
||||||
|
|
||||||
public void onLightningStrike(EntityLightning entitylightning) {
|
public void onLightningStrike(EntityLightning entitylightning) {
|
||||||
super.onLightningStrike(entitylightning);
|
super.onLightningStrike(entitylightning);
|
||||||
|
- this.datawatcher.set(EntityCreeper.b, Boolean.valueOf(true));
|
||||||
+ // CraftBukkit start
|
+ // CraftBukkit start
|
||||||
+ if (CraftEventFactory.callCreeperPowerEvent(this, entitylightning, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) {
|
+ if (CraftEventFactory.callCreeperPowerEvent(this, entitylightning, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) {
|
||||||
+ return;
|
+ return;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ this.setPowered(true);
|
+ 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) {
|
protected boolean a(EntityHuman entityhuman, EnumHand enumhand, @Nullable ItemStack itemstack) {
|
||||||
if (itemstack != null && itemstack.getItem() == Items.FLINT_AND_STEEL) {
|
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 @@
|
@@ -180,9 +195,17 @@
|
||||||
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
|
boolean flag = this.world.getGameRules().getBoolean("mobGriefing");
|
||||||
float f = this.isPowered() ? 2.0F : 1.0F;
|
float f = this.isPowered() ? 2.0F : 1.0F;
|
||||||
|
|
Loading…
Add table
Reference in a new issue