SPIGOT-6015: Small Armor Stand doesn't drop items

This commit is contained in:
md_5 2020-07-22 18:45:52 +10:00
parent 5db13eea60
commit d492e363b8
No known key found for this signature in database
GPG key ID: E8E901AC7C617C11

View file

@ -468,7 +468,7 @@
}
}
@@ -1193,28 +1420,48 @@
@@ -1193,28 +1420,46 @@
boolean flag = this.lastDamageByPlayerTime > 0;
@ -476,13 +476,11 @@
if (this.cV() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
this.a(damagesource, flag);
this.dropDeathLoot(damagesource, i, flag);
}
+ // CraftBukkit start - Call death event
+ CraftEventFactory.callEntityDeathEvent(this, this.drops);
+ this.drops = new ArrayList<org.bukkit.inventory.ItemStack>();
+ } else {
+ CraftEventFactory.callEntityDeathEvent(this);
+ this.drops = new ArrayList<>();
+ // CraftBukkit end
}
- this.dropInventory();
+ // this.dropInventory();// CraftBukkit - moved up
@ -519,7 +517,7 @@
}
@@ -1335,9 +1582,14 @@
@@ -1335,9 +1580,14 @@
int i = this.e(f, f1);
if (i > 0) {
@ -535,7 +533,7 @@
return true;
} else {
return flag;
@@ -1377,7 +1629,7 @@
@@ -1377,7 +1627,7 @@
protected float applyArmorModifier(DamageSource damagesource, float f) {
if (!damagesource.ignoresArmor()) {
@ -544,7 +542,7 @@
f = CombatMath.a(f, (float) this.getArmorStrength(), (float) this.b(GenericAttributes.ARMOR_TOUGHNESS));
}
@@ -1390,7 +1642,8 @@
@@ -1390,7 +1640,8 @@
} else {
int i;
@ -554,7 +552,7 @@
i = (this.getEffect(MobEffects.RESISTANCE).getAmplifier() + 1) * 5;
int j = 25 - i;
float f1 = f * (float) j;
@@ -1421,28 +1674,173 @@
@@ -1421,28 +1672,173 @@
}
}
@ -738,7 +736,7 @@
}
public CombatTracker getCombatTracker() {
@@ -1814,6 +2212,7 @@
@@ -1814,6 +2210,7 @@
}
if (this.onGround && !this.world.isClientSide) {
@ -746,7 +744,7 @@
this.setFlag(7, false);
}
} else {
@@ -2319,6 +2718,7 @@
@@ -2319,6 +2716,7 @@
}
if (!this.world.isClientSide) {
@ -754,7 +752,7 @@
this.setFlag(7, flag);
}
@@ -2439,6 +2839,7 @@
@@ -2439,6 +2837,7 @@
}
public boolean hasLineOfSight(Entity entity) {
@ -762,7 +760,7 @@
Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ());
Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ());
@@ -2456,13 +2857,20 @@
@@ -2456,13 +2855,20 @@
@Override
public boolean isInteractable() {
@ -785,7 +783,7 @@
@Override
protected void velocityChanged() {
@@ -2645,7 +3053,27 @@
@@ -2645,7 +3051,27 @@
} else {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16);
@ -814,7 +812,7 @@
this.clearActiveItem();
}
@@ -2732,10 +3160,18 @@
@@ -2732,10 +3158,18 @@
}
if (flag2) {
@ -836,7 +834,7 @@
}
}
@@ -2832,7 +3268,7 @@
@@ -2832,7 +3266,7 @@
}
public void entityWakeup() {
@ -845,7 +843,7 @@
World world = this.world;
this.world.getClass();
@@ -2899,7 +3335,7 @@
@@ -2899,7 +3333,7 @@
Pair<MobEffect, Float> pair = (Pair) iterator.next();
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {