summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityPotion.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityPotion.patch')
-rw-r--r--nms-patches/EntityPotion.patch35
1 files changed, 20 insertions, 15 deletions
diff --git a/nms-patches/EntityPotion.patch b/nms-patches/EntityPotion.patch
index b29dbc17..5d169e65 100644
--- a/nms-patches/EntityPotion.patch
+++ b/nms-patches/EntityPotion.patch
@@ -1,6 +1,6 @@
---- ../work/decompile-8eb82bde//net/minecraft/server/EntityPotion.java 2014-11-28 17:43:43.149707434 +0000
-+++ src/main/java/net/minecraft/server/EntityPotion.java 2014-11-28 17:38:21.000000000 +0000
-@@ -3,6 +3,13 @@
+--- /home/matt/mc-dev-private//net/minecraft/server/EntityPotion.java 2015-02-26 22:40:22.663608139 +0000
++++ src/main/java/net/minecraft/server/EntityPotion.java 2015-02-26 22:40:22.663608139 +0000
+@@ -3,9 +3,16 @@
import java.util.Iterator;
import java.util.List;
@@ -13,9 +13,13 @@
+
public class EntityPotion extends EntityProjectile {
- public ItemStack item;
-@@ -57,12 +64,15 @@
- if (!this.world.isStatic) {
+- private ItemStack item;
++ public ItemStack item; // CraftBukkit - public
+
+ public EntityPotion(World world) {
+ super(world);
+@@ -57,13 +64,16 @@
+ if (!this.world.isClientSide) {
List list = Items.POTION.h(this.item);
- if (list != null && !list.isEmpty()) {
@@ -24,19 +28,19 @@
List list1 = this.world.a(EntityLiving.class, axisalignedbb);
- if (!list1.isEmpty()) {
-+ if (true || !list1.isEmpty()) { // CraftBukkit - Run code even if there are no entities around
++ if (true || !list1.isEmpty()) { // CraftBukkit - Run code even if there are no entities around
Iterator iterator = list1.iterator();
-+
+
+ // CraftBukkit
+ HashMap<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>();
-
++
while (iterator.hasNext()) {
EntityLiving entityliving = (EntityLiving) iterator.next();
-@@ -74,12 +84,35 @@
- if (entityliving == movingobjectposition.entity) {
+ double d0 = this.h(entityliving);
+@@ -75,12 +85,35 @@
d1 = 1.0D;
}
-+
+
+ // CraftBukkit start
+ affected.put((LivingEntity) entityliving.getBukkitEntity(), d1);
+ }
@@ -52,19 +56,20 @@
+ EntityLiving entityliving = ((CraftLivingEntity) victim).getHandle();
+ double d1 = event.getIntensity(victim);
+ // CraftBukkit end
-
++
Iterator iterator1 = list.iterator();
while (iterator1.hasNext()) {
MobEffect mobeffect = (MobEffect) iterator1.next();
int i = mobeffect.getEffectId();
-+
+
+ // CraftBukkit start - Abide by PVP settings - for players only!
+ if (!this.world.pvpMode && this.getShooter() instanceof EntityPlayer && entityliving instanceof EntityPlayer && entityliving != this.getShooter()) {
+ // 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].isInstant()) {
MobEffectList.byId[i].applyInstantEffect(this, this.getShooter(), entityliving, mobeffect.getAmplifier(), d1);
+ } else {