mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 21:07:36 +01:00
Fixed losing an infinite item when interacting with an entity. Thanks for the help Rigby!
This commit is contained in:
parent
12b7499c4f
commit
a6e5c97223
@ -512,7 +512,8 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
|
|
||||||
if (itemstack != null && entity instanceof EntityLiving) {
|
if (itemstack != null && entity instanceof EntityLiving) {
|
||||||
itemstack.a((EntityLiving) entity);
|
itemstack.a((EntityLiving) entity);
|
||||||
if (itemstack.count <= 0) {
|
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||||
|
if (itemstack.count == 0) {
|
||||||
itemstack.a(this);
|
itemstack.a(this);
|
||||||
this.G();
|
this.G();
|
||||||
}
|
}
|
||||||
@ -573,7 +574,8 @@ public abstract class EntityHuman extends EntityLiving {
|
|||||||
|
|
||||||
if (itemstack != null && entity instanceof EntityLiving) {
|
if (itemstack != null && entity instanceof EntityLiving) {
|
||||||
itemstack.a((EntityLiving) entity, this);
|
itemstack.a((EntityLiving) entity, this);
|
||||||
if (itemstack.count <= 0) {
|
// CraftBukkit - bypass infinite items; <= 0 -> == 0
|
||||||
|
if (itemstack.count == 0) {
|
||||||
itemstack.a(this);
|
itemstack.a(this);
|
||||||
this.G();
|
this.G();
|
||||||
}
|
}
|
||||||
|
@ -869,8 +869,18 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
this.player.c(entity);
|
this.player.c(entity);
|
||||||
|
// CraftBukkit start - update the client if the item is an infinite one
|
||||||
|
if (this.player.inventory.getItemInHand().count <= -1) {
|
||||||
|
this.player.a(this.player.activeContainer);
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
} else if (packet7useentity.c == 1) {
|
} else if (packet7useentity.c == 1) {
|
||||||
this.player.d(entity);
|
this.player.d(entity);
|
||||||
|
// CraftBukkit start - update the client if the item is an infinite one
|
||||||
|
if (this.player.inventory.getItemInHand().count <= -1) {
|
||||||
|
this.player.a(this.player.activeContainer);
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user