2018-07-04 09:55:24 +02:00
|
|
|
From fecfe061f41f0aaced5637ec3813aac206c4bbfc 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
|
|
|
|
index ffe72e037..3a00a37eb 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
|
|
|
@@ -71,7 +71,11 @@ public class EntityWitch extends EntityMonster implements IRangedEntity {
|
|
|
|
|
|
|
|
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 07:40:52 +02:00
|
|
|
2.18.0
|
2018-05-17 02:35:33 +02:00
|
|
|
|