SPIGOT-840, SPIGOT-2522: [Draft] Add EntityPotionEffectChangeEvent

Discussion ongoing in PR #449

By: kaenganxt <kaenganxt@mc-anura.de>
This commit is contained in:
CraftBukkit/Spigot
2018-07-20 16:04:37 +10:00
parent 300a2a1daf
commit 15a21299da
33 changed files with 617 additions and 47 deletions

View File

@@ -51,6 +51,15 @@
public EntityHuman(World world, GameProfile gameprofile) {
super(EntityTypes.PLAYER, world);
this.cd = ItemStack.a;
@@ -184,7 +208,7 @@
ItemStack itemstack = this.getEquipment(EnumItemSlot.HEAD);
if (itemstack.getItem() == Items.TURTLE_HELMET && !this.a(TagsFluid.a)) {
- this.addEffect(new MobEffect(MobEffects.WATER_BREATHING, 200, 0, false, false, true));
+ this.addEffect(new MobEffect(MobEffects.WATER_BREATHING, 200, 0, false, false, true), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.TURTLE_HELMET); // CraftBukkit
}
}
@@ -369,7 +393,8 @@
if (this.world.getDifficulty() == EnumDifficulty.PEACEFUL && this.world.getGameRules().getBoolean("naturalRegeneration")) {