2019-01-01 04:15:55 +01:00
|
|
|
From 26d079a08350eced70d6ca1f352a07ee74d2450d Mon Sep 17 00:00:00 2001
|
2018-05-17 02:35:33 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Wed, 16 May 2018 20:35:16 -0400
|
|
|
|
Subject: [PATCH] WitchConsumePotionEvent
|
|
|
|
|
|
|
|
Fires when a witch consumes the potion in their hand
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
|
2019-01-01 04:15:55 +01:00
|
|
|
index eaae9ea9a..0d579c7e4 100644
|
2018-05-17 02:35:33 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
2018-07-19 01:16:19 +02:00
|
|
|
@@ -67,7 +67,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
2018-05-17 02:35:33 +02:00
|
|
|
|
|
|
|
this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a);
|
|
|
|
if (itemstack.getItem() == Items.POTION) {
|
2019-01-01 04:15:55 +01:00
|
|
|
- List<MobEffect> list = PotionUtil.getEffects(itemstack);
|
2018-05-17 02:35:33 +02:00
|
|
|
+ // Paper start
|
|
|
|
+ com.destroystokyo.paper.event.entity.WitchConsumePotionEvent event = new com.destroystokyo.paper.event.entity.WitchConsumePotionEvent((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack));
|
|
|
|
+
|
2019-01-01 04:15:55 +01:00
|
|
|
+ List<MobEffect> list = event.callEvent() ? PotionUtil.getEffects(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion())) : null;
|
2018-05-17 02:35:33 +02:00
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (list != null) {
|
|
|
|
Iterator iterator = list.iterator();
|
|
|
|
--
|
2019-01-01 04:15:55 +01:00
|
|
|
2.20.1
|
2018-05-17 02:35:33 +02:00
|
|
|
|