mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 02:59:55 +01:00
[Bleeding] Improve handling of ItemStacks. Addresses BUKKIT-1697
This commit is contained in:
parent
0f984dd9a5
commit
21327265f0
1 changed files with 10 additions and 3 deletions
|
@ -119,7 +119,11 @@ public abstract class Container {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j == 1) {
|
if (j == 1) {
|
||||||
entityhuman.drop(playerinventory.getCarried().a(1));
|
// CraftBukkit start
|
||||||
|
if (playerinventory.getCarried().count > 0) {
|
||||||
|
entityhuman.drop(playerinventory.getCarried().a(1));
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
if (playerinventory.getCarried().count == 0) {
|
if (playerinventory.getCarried().count == 0) {
|
||||||
playerinventory.setCarried((ItemStack) null);
|
playerinventory.setCarried((ItemStack) null);
|
||||||
}
|
}
|
||||||
|
@ -162,8 +166,11 @@ public abstract class Container {
|
||||||
if (l > slot1.a()) {
|
if (l > slot1.a()) {
|
||||||
l = slot1.a();
|
l = slot1.a();
|
||||||
}
|
}
|
||||||
|
// CraftBukkit start
|
||||||
slot1.set(itemstack3.a(l));
|
if (itemstack3.count >= l) {
|
||||||
|
slot1.set(itemstack3.a(l));
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
if (itemstack3.count == 0) {
|
if (itemstack3.count == 0) {
|
||||||
playerinventory.setCarried((ItemStack) null);
|
playerinventory.setCarried((ItemStack) null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue