Implemented inventory capacity

This commit is contained in:
Anuken
2018-04-14 12:00:42 -04:00
parent fcf62ada8f
commit 4e77f24a06
8 changed files with 70 additions and 27 deletions

View File

@@ -64,12 +64,13 @@ public abstract class InputHandler extends InputAdapter{
public void dropItem(Tile tile, ItemStack stack){
if(tile.block().acceptStack(stack, tile, player)){
tile.block().handleStack(stack, tile, player);
player.inventory.clear();
int accepted = tile.block().handleStack(stack, tile, player);
stack.amount -= accepted;
if(stack.amount == 0) player.inventory.clear();
float backTrns = 3f;
int sent = Mathf.clamp(stack.amount/3, 1, 8);
int sent = Mathf.clamp(accepted/4, 1, 8);
for(int i = 0; i < sent; i ++){
Timers.run(i * 3, () -> {
new ItemAnimationEffect(stack.item,