summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityLiving.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityLiving.patch')
-rw-r--r--nms-patches/EntityLiving.patch24
1 files changed, 10 insertions, 14 deletions
diff --git a/nms-patches/EntityLiving.patch b/nms-patches/EntityLiving.patch
index f9e8cac3..44ba66dd 100644
--- a/nms-patches/EntityLiving.patch
+++ b/nms-patches/EntityLiving.patch
@@ -28,8 +28,8 @@
+ // CraftBukkit start
+ public int expToDrop;
+ public int maxAirTicks = 300;
-+ ArrayList<org.bukkit.inventory.ItemStack> drops;
-+ public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
++ ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
++ public org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
+ // CraftBukkit end
public void Q() {
@@ -302,24 +302,20 @@
this.az = 0.0F;
Entity entity = damagesource.getEntity();
-@@ -822,9 +956,16 @@
- }
-
- if (this.isDropExperience() && this.world.getGameRules().getBoolean("doMobLoot")) {
-+ this.drops = new ArrayList<org.bukkit.inventory.ItemStack>(); // CraftBukkit - Setup drop capture
+@@ -825,6 +959,12 @@
boolean flag = this.lastDamageByPlayerTime > 0;
this.a(flag, i, damagesource);
+ // CraftBukkit start - Call death event
+ CraftEventFactory.callEntityDeathEvent(this, this.drops);
-+ this.drops = null;
++ this.drops = new ArrayList<org.bukkit.inventory.ItemStack>();
+ } else {
+ CraftEventFactory.callEntityDeathEvent(this);
+ // CraftBukkit end
}
}
-@@ -912,8 +1053,13 @@
+@@ -912,8 +1052,13 @@
int i = MathHelper.f((f - 3.0F - f2) * f1);
if (i > 0) {
@@ -334,7 +330,7 @@
int j = MathHelper.floor(this.locX);
int k = MathHelper.floor(this.locY - 0.20000000298023224D);
int l = MathHelper.floor(this.locZ);
-@@ -940,20 +1086,20 @@
+@@ -940,20 +1085,20 @@
protected float applyArmorModifier(DamageSource damagesource, float f) {
if (!damagesource.ignoresArmor()) {
@@ -358,7 +354,7 @@
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i;
float f1 = f * (float) j;
-@@ -974,22 +1120,122 @@
+@@ -974,22 +1119,122 @@
}
}
@@ -488,7 +484,7 @@
}
public CombatTracker getCombatTracker() {
-@@ -1055,6 +1301,7 @@
+@@ -1055,6 +1300,7 @@
public AttributeMapBase getAttributeMap() {
if (this.bp == null) {
this.bp = new AttributeMapServer();
@@ -496,7 +492,7 @@
}
return this.bp;
-@@ -1702,6 +1949,13 @@
+@@ -1702,6 +1948,13 @@
if (!list.isEmpty()) {
for (int i = 0; i < list.size(); ++i) {
Entity entity = (Entity) list.get(i);
@@ -510,7 +506,7 @@
this.C(entity);
}
-@@ -1918,7 +2172,22 @@
+@@ -1918,7 +2171,22 @@
protected void v() {
if (this.bm != null && this.cs()) {
this.a(this.bm, 16);