mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-25 12:05:53 +01:00
611a0ee52d
This reverts commit e38eceb42a
.
25 lines
1.5 KiB
Diff
25 lines
1.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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 43bc7f509b00b40c3fa7031546a52154c39b093d..4f2212ed9abb00e86c3d80d7facc7298f7a07b89 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityWitch.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
|
|
@@ -85,7 +85,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
|
|
|
|
this.setSlot(EnumItemSlot.MAINHAND, ItemStack.b);
|
|
if (itemstack.getItem() == Items.POTION) {
|
|
- List<MobEffect> 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<MobEffect> list = event.callEvent() ? PotionUtil.getEffects(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion())) : null;
|
|
+ // Paper end
|
|
|
|
if (list != null) {
|
|
Iterator iterator = list.iterator();
|