diff --git a/Spigot-API-Patches/WitchThrowPotionEvent.patch b/Spigot-API-Patches/WitchThrowPotionEvent.patch index 6cd52985c2..0cb21f1864 100644 --- a/Spigot-API-Patches/WitchThrowPotionEvent.patch +++ b/Spigot-API-Patches/WitchThrowPotionEvent.patch @@ -6,13 +6,13 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java -index 6ef6367b..2f4ce49e 100644 +index 6ef6367b..77487e28 100644 --- a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java @@ -0,0 +0,0 @@ package com.destroystokyo.paper.event.entity; -+import org.bukkit.entity.Player; ++import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Witch; import org.bukkit.event.Cancellable; -import org.bukkit.event.Event; @@ -26,10 +26,10 @@ index 6ef6367b..2f4ce49e 100644 + * Fired when a witch throws a potion at a player + */ +public class WitchThrowPotionEvent extends EntityEvent implements Cancellable { -+ private final Player target; ++ private final LivingEntity target; + private ItemStack potion; + -+ public WitchThrowPotionEvent(Witch witch, Player target, ItemStack potion) { ++ public WitchThrowPotionEvent(Witch witch, LivingEntity target, ItemStack potion) { + super(witch); + this.target = target; + this.potion = potion; @@ -43,7 +43,7 @@ index 6ef6367b..2f4ce49e 100644 + /** + * @return The target of the potion + */ -+ public Player getTarget() { ++ public LivingEntity getTarget() { + return target; + } + diff --git a/Spigot-Server-Patches/WitchThrowPotionEvent.patch b/Spigot-Server-Patches/WitchThrowPotionEvent.patch index 3a9b868f9f..37c305a858 100644 --- a/Spigot-Server-Patches/WitchThrowPotionEvent.patch +++ b/Spigot-Server-Patches/WitchThrowPotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 3a00a37eb..f51989588 100644 +index 3a00a37eb..bf029ad1c 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { @@ -16,7 +16,7 @@ index 3a00a37eb..f51989588 100644 - EntityPotion entitypotion = new EntityPotion(this.world, this, PotionUtil.a(new ItemStack(Items.SPLASH_POTION), potionregistry)); + // Paper start + ItemStack potion = PotionUtil.a(new ItemStack(Items.SPLASH_POTION), potionregistry); -+ com.destroystokyo.paper.event.entity.WitchThrowPotionEvent event = new com.destroystokyo.paper.event.entity.WitchThrowPotionEvent((org.bukkit.entity.Witch) this.getBukkitEntity(), (org.bukkit.entity.Player) entityliving.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); ++ com.destroystokyo.paper.event.entity.WitchThrowPotionEvent event = new com.destroystokyo.paper.event.entity.WitchThrowPotionEvent((org.bukkit.entity.Witch) this.getBukkitEntity(), (org.bukkit.entity.LivingEntity) entityliving.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); + if (!event.callEvent()) { + return; + }