2018-07-21 21:24:18 +00:00
|
|
|
From 0cbe97f322932b592af43ff5b7382b9a102e6f41 Mon Sep 17 00:00:00 2001
|
2018-05-17 00:35:33 +00: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
|
2018-07-21 21:24:18 +00:00
|
|
|
index 524d84c5b..c77328e76 100644
|
2018-05-17 00:35:33 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
2018-07-18 23:16:19 +00:00
|
|
|
@@ -67,7 +67,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
2018-05-17 00:35:33 +00:00
|
|
|
|
|
|
|
this.setSlot(EnumItemSlot.MAINHAND, ItemStack.a);
|
|
|
|
if (itemstack.getItem() == Items.POTION) {
|
|
|
|
- List list = PotionUtil.getEffects(itemstack);
|
|
|
|
+ // 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));
|
|
|
|
+
|
|
|
|
+ List list = event.callEvent() ? PotionUtil.getEffects(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion())) : null;
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
if (list != null) {
|
|
|
|
Iterator iterator = list.iterator();
|
|
|
|
--
|
2018-06-30 05:40:52 +00:00
|
|
|
2.18.0
|
2018-05-17 00:35:33 +00:00
|
|
|
|