Paper/Spigot-Server-Patches/0224-WitchReadyPotionEvent.patch

27 lines
1.6 KiB
Diff
Raw Normal View History

From ec353e040667da4498b275444cbd0e0b3d5a1eb9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Jun 2018 22:47:26 -0400
Subject: [PATCH] WitchReadyPotionEvent
diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java
index 1f2759e95..be6ecfb08 100644
--- a/src/main/java/net/minecraft/server/EntityWitch.java
+++ b/src/main/java/net/minecraft/server/EntityWitch.java
2019-04-29 03:14:31 +00:00
@@ -121,7 +121,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity {
}
if (potionregistry != null) {
- this.setSlot(EnumItemSlot.MAINHAND, PotionUtil.a(new ItemStack(Items.POTION), potionregistry));
+ // Paper start
+ ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry);
+ org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion));
+ this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack));
+ // Paper end
2019-12-11 23:43:22 +00:00
this.by = this.getItemInMainHand().k();
this.t(true);
this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F);
--
2.25.0.windows.1