Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
4104545b11
"It was from a different time before books were as jank as they are now. As time has gone on they've only proven to be worse and worse."
25 Zeilen
1.5 KiB
Diff
25 Zeilen
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/world/entity/monster/Witch.java b/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
|
index 0c04665c6e2f5624e21e269d706fea842d54cefd..ecb3843ff3b4f0034f6aaa16cfc09cbd046d9008 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Witch.java
|
|
@@ -124,7 +124,11 @@ public class Witch extends Raider implements RangedAttackMob {
|
|
|
|
this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
|
|
if (itemstack.is(Items.POTION)) {
|
|
- List<MobEffectInstance> list = PotionUtils.getMobEffects(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<MobEffectInstance> list = event.callEvent() ? PotionUtils.getMobEffects(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getPotion())) : null;
|
|
+ // Paper end
|
|
|
|
if (list != null) {
|
|
Iterator iterator = list.iterator();
|