Notify player of inv changes when filling
This commit is contained in:
parent
d7575d74ea
commit
4a21f4ce24
1 changed files with 5 additions and 4 deletions
|
@ -36,6 +36,7 @@ public class FluidUtils {
|
||||||
if (used > 0) {
|
if (used > 0) {
|
||||||
if (!player.capabilities.isCreativeMode) {
|
if (!player.capabilities.isCreativeMode) {
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, InvUtils.consumeItem(current));
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, InvUtils.consumeItem(current));
|
||||||
|
player.inventory.onInventoryChanged();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -50,14 +51,14 @@ public class FluidUtils {
|
||||||
if (liquid != null) {
|
if (liquid != null) {
|
||||||
|
|
||||||
if (current.stackSize > 1) {
|
if (current.stackSize > 1) {
|
||||||
if (!player.inventory.addItemStackToInventory(filled)) {
|
if (!player.inventory.addItemStackToInventory(filled))
|
||||||
return false;
|
return false;
|
||||||
} else {
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, InvUtils.consumeItem(current));
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, InvUtils.consumeItem(current));
|
player.inventory.onInventoryChanged();
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, InvUtils.consumeItem(current));
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, InvUtils.consumeItem(current));
|
||||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, filled);
|
player.inventory.setInventorySlotContents(player.inventory.currentItem, filled);
|
||||||
|
player.inventory.onInventoryChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
tank.drain(side, liquid.amount, true);
|
tank.drain(side, liquid.amount, true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue