From da1aead88a99412cc5f85b8a5c1f0ae051084b08 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Wed, 8 Feb 2012 21:02:18 -0500 Subject: [PATCH] Made splash options abide by PVP settings. Fixes BUKKIT-542 --- src/main/java/net/minecraft/server/EntityPotion.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java index 3641e52ff7..c166c5d35a 100644 --- a/src/main/java/net/minecraft/server/EntityPotion.java +++ b/src/main/java/net/minecraft/server/EntityPotion.java @@ -93,6 +93,13 @@ public class EntityPotion extends EntityProjectile { MobEffect mobeffect = (MobEffect) iterator1.next(); int i = mobeffect.getEffectId(); + // CraftBukkit start - abide by PVP settings + if (!this.world.pvpMode && entity instanceof EntityPlayer && entity != this.shooter) { + // Block SLOWER_MOVEMENT, SLOWER_DIG, HARM, BLINDNESS, HUNGER, WEAKNESS and POISON potions + if (i == 2 || i == 4 || i == 7 || i == 15 || i == 17 || i == 18 || i == 19) continue; + } + // CraftBukkit end + if (MobEffectList.byId[i].b()) { MobEffectList.byId[i].a(this.shooter, (EntityLiving) entity, mobeffect.getAmplifier(), d1, this); // CraftBukkit - added 'this' } else {