blob: e518e8dd844f648bc29666b811334790a0269e49 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--- a/net/minecraft/world/entity/monster/Witch.java
+++ b/net/minecraft/world/entity/monster/Witch.java
@@ -123,11 +125,16 @@
this.setUsingItem(false);
ItemStack mainHandItem = this.getMainHandItem();
this.setItemSlot(EquipmentSlot.MAINHAND, ItemStack.EMPTY);
- if (mainHandItem.is(Items.POTION)) {
- List<MobEffectInstance> mobEffects = PotionUtils.getMobEffects(mainHandItem);
- if (mobEffects != null) {
- for (MobEffectInstance mobEffectInstance : mobEffects) {
- this.addEffect(new MobEffectInstance(mobEffectInstance));
+ if (itemstack.is(Items.POTION)) {
+ List<MobEffectInstance> list = PotionUtils.getMobEffects(itemstack);
+
+ if (list != null) {
+ Iterator iterator = list.iterator();
+
+ while (iterator.hasNext()) {
+ MobEffectInstance mobeffect = (MobEffectInstance) iterator.next();
+
+ this.addEffect(new MobEffectInstance(mobeffect), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
}
}
}
|