summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2012-02-08 21:02:18 -0500
committerEvilSeph <evilseph@gmail.com>2012-02-10 19:23:22 -0500
commitda1aead88a99412cc5f85b8a5c1f0ae051084b08 (patch)
treeee2626713a042a65d4674eba9634646e819b9db4 /src/main/java/net/minecraft/server
parentf52665348e3cf0e4896c9eb32c0e3c855a6d92e2 (diff)
downloadcraftbukkit-da1aead88a99412cc5f85b8a5c1f0ae051084b08.tar
craftbukkit-da1aead88a99412cc5f85b8a5c1f0ae051084b08.tar.gz
craftbukkit-da1aead88a99412cc5f85b8a5c1f0ae051084b08.tar.lz
craftbukkit-da1aead88a99412cc5f85b8a5c1f0ae051084b08.tar.xz
craftbukkit-da1aead88a99412cc5f85b8a5c1f0ae051084b08.zip
Made splash options abide by PVP settings. Fixes BUKKIT-542
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r--src/main/java/net/minecraft/server/EntityPotion.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java
index 3641e52f..c166c5d3 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 {