mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-17 16:15:24 +01:00
SPIGOT-6109: Improve loot handling
This commit is contained in:
parent
bfea455968
commit
bf451617f3
@ -209,7 +209,15 @@
|
||||
this.world.getMethodProfiler().enter("sensing");
|
||||
this.bo.a();
|
||||
this.world.getMethodProfiler().exit();
|
||||
@@ -1023,6 +1106,12 @@
|
||||
@@ -807,6 +890,7 @@
|
||||
|
||||
this.a(itemstack);
|
||||
}
|
||||
+ this.setSlot(enumitemslot, ItemStack.b); // CraftBukkit - SPIGOT-6109
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1023,6 +1107,12 @@
|
||||
if (!this.isAlive()) {
|
||||
return EnumInteractionResult.PASS;
|
||||
} else if (this.getLeashHolder() == entityhuman) {
|
||||
@ -222,7 +230,7 @@
|
||||
this.unleash(true, !entityhuman.abilities.canInstantlyBuild);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
} else {
|
||||
@@ -1041,6 +1130,12 @@
|
||||
@@ -1041,6 +1131,12 @@
|
||||
ItemStack itemstack = entityhuman.b(enumhand);
|
||||
|
||||
if (itemstack.getItem() == Items.LEAD && this.a(entityhuman)) {
|
||||
@ -235,7 +243,7 @@
|
||||
this.setLeashHolder(entityhuman, true);
|
||||
itemstack.subtract(1);
|
||||
return EnumInteractionResult.a(this.world.isClientSide);
|
||||
@@ -1056,7 +1151,7 @@
|
||||
@@ -1056,7 +1152,7 @@
|
||||
if (itemstack.getItem() instanceof ItemMonsterEgg) {
|
||||
if (this.world instanceof WorldServer) {
|
||||
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
|
||||
@ -244,7 +252,7 @@
|
||||
|
||||
optional.ifPresent((entityinsentient) -> {
|
||||
this.a(entityhuman, entityinsentient);
|
||||
@@ -1102,12 +1197,19 @@
|
||||
@@ -1102,12 +1198,19 @@
|
||||
return this.bA != -1.0F;
|
||||
}
|
||||
|
||||
@ -265,7 +273,7 @@
|
||||
|
||||
t0.u(this);
|
||||
t0.setBaby(this.isBaby());
|
||||
@@ -1139,7 +1241,12 @@
|
||||
@@ -1139,7 +1242,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,7 +287,7 @@
|
||||
if (this.isPassenger()) {
|
||||
Entity entity = this.getVehicle();
|
||||
|
||||
@@ -1159,6 +1266,7 @@
|
||||
@@ -1159,6 +1267,7 @@
|
||||
|
||||
if (this.leashHolder != null) {
|
||||
if (!this.isAlive() || !this.leashHolder.isAlive()) {
|
||||
@ -287,7 +295,7 @@
|
||||
this.unleash(true, true);
|
||||
}
|
||||
|
||||
@@ -1175,7 +1283,9 @@
|
||||
@@ -1175,7 +1284,9 @@
|
||||
this.leashHolder = null;
|
||||
this.by = null;
|
||||
if (!this.world.isClientSide && flag1) {
|
||||
@ -297,7 +305,7 @@
|
||||
}
|
||||
|
||||
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
|
||||
@@ -1225,6 +1335,7 @@
|
||||
@@ -1225,6 +1336,7 @@
|
||||
boolean flag1 = super.a(entity, flag);
|
||||
|
||||
if (flag1 && this.isLeashed()) {
|
||||
@ -305,7 +313,7 @@
|
||||
this.unleash(true, true);
|
||||
}
|
||||
|
||||
@@ -1357,7 +1468,14 @@
|
||||
@@ -1357,7 +1469,14 @@
|
||||
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
|
||||
|
||||
if (i > 0) {
|
||||
@ -321,7 +329,7 @@
|
||||
}
|
||||
|
||||
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
|
||||
@@ -1419,6 +1537,7 @@
|
||||
@@ -1419,6 +1538,7 @@
|
||||
@Override
|
||||
protected void bM() {
|
||||
super.bM();
|
||||
|
Loading…
Reference in New Issue
Block a user