diff --git a/nms-patches/EntityLiving.patch b/nms-patches/EntityLiving.patch index fd6a84ef2..34ce357f4 100644 --- a/nms-patches/EntityLiving.patch +++ b/nms-patches/EntityLiving.patch @@ -490,7 +490,21 @@ } } -@@ -1194,28 +1428,46 @@ +@@ -1175,6 +1409,13 @@ + if (!flag) { + EntityItem entityitem = new EntityItem(this.world, this.locX(), this.locY(), this.locZ(), new ItemStack(Items.bt)); + ++ // CraftBukkit start ++ org.bukkit.event.entity.EntityDropItemEvent event = new org.bukkit.event.entity.EntityDropItemEvent(this.getBukkitEntity(), (org.bukkit.entity.Item) entityitem.getBukkitEntity()); ++ CraftEventFactory.callEvent(event); ++ if (event.isCancelled()) { ++ return; ++ } ++ // CraftBukkit end + this.world.addEntity(entityitem); + } + } +@@ -1194,28 +1435,46 @@ boolean flag = this.lastDamageByPlayerTime > 0; @@ -539,7 +553,7 @@ } -@@ -1336,9 +1588,14 @@ +@@ -1336,9 +1595,14 @@ int i = this.e(f, f1); if (i > 0) { @@ -555,7 +569,7 @@ return true; } else { return flag; -@@ -1378,7 +1635,7 @@ +@@ -1378,7 +1642,7 @@ protected float applyArmorModifier(DamageSource damagesource, float f) { if (!damagesource.ignoresArmor()) { @@ -564,7 +578,7 @@ f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.b(GenericAttributes.ARMOR_TOUGHNESS)); } -@@ -1391,7 +1648,8 @@ +@@ -1391,7 +1655,8 @@ } else { int i; @@ -574,7 +588,7 @@ i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5; int j = 25 - i; float f1 = f * (float) j; -@@ -1422,28 +1680,173 @@ +@@ -1422,28 +1687,173 @@ } } @@ -758,7 +772,7 @@ } public CombatTracker getCombatTracker() { -@@ -1464,9 +1867,19 @@ +@@ -1464,9 +1874,19 @@ } public final void setArrowCount(int i) { @@ -779,7 +793,7 @@ public final int dz() { return (Integer) this.datawatcher.get(EntityLiving.bi); } -@@ -1594,6 +2007,12 @@ +@@ -1594,6 +2014,12 @@ public abstract ItemStack getEquipment(EnumItemSlot enumitemslot); @@ -792,7 +806,7 @@ @Override public abstract void setSlot(EnumItemSlot enumitemslot, ItemStack itemstack); -@@ -1816,6 +2235,7 @@ +@@ -1816,6 +2242,7 @@ } if (this.onGround && !this.world.isClientSide) { @@ -800,7 +814,7 @@ this.setFlag(7, false); } } else { -@@ -1957,7 +2377,7 @@ +@@ -1957,7 +2384,7 @@ } } @@ -809,7 +823,7 @@ if (this.ticksLived % 20 == 0) { this.getCombatTracker().g(); } -@@ -2058,7 +2478,7 @@ +@@ -2058,7 +2485,7 @@ } @@ -818,7 +832,7 @@ Map map = this.q(); if (map != null) { -@@ -2321,6 +2741,7 @@ +@@ -2321,6 +2748,7 @@ } if (!this.world.isClientSide) { @@ -826,7 +840,7 @@ this.setFlag(7, flag); } -@@ -2441,6 +2862,7 @@ +@@ -2441,6 +2869,7 @@ } public boolean hasLineOfSight(Entity entity) { @@ -834,7 +848,7 @@ Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ()); Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ()); -@@ -2458,14 +2880,21 @@ +@@ -2458,14 +2887,21 @@ @Override public boolean isInteractable() { @@ -858,7 +872,7 @@ @Override protected void velocityChanged() { this.velocityChanged = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE); -@@ -2658,7 +3087,25 @@ +@@ -2658,7 +3094,25 @@ } else { if (!this.activeItem.isEmpty() && this.isHandRaised()) { this.b(this.activeItem, 16); @@ -885,7 +899,7 @@ if (itemstack != this.activeItem) { this.a(enumhand, itemstack); -@@ -2750,10 +3197,18 @@ +@@ -2750,10 +3204,18 @@ } if (flag2) { @@ -907,7 +921,7 @@ } } -@@ -2850,7 +3305,7 @@ +@@ -2850,7 +3312,7 @@ } public void entityWakeup() { @@ -916,7 +930,7 @@ World world = this.world; this.world.getClass(); -@@ -2921,7 +3376,7 @@ +@@ -2921,7 +3383,7 @@ Pair pair = (Pair) iterator.next(); if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {