Utils ported

This commit is contained in:
Sebastian Hartte
2020-06-28 13:28:14 +02:00
parent fee5b7fdfc
commit 46955643b9
105 changed files with 239 additions and 379 deletions
@@ -127,12 +127,12 @@ public class AppEngSlot extends Slot {
@Override
public int getSlotStackLimit() {
return this.itemHandler.getSlotLimit(this.index);
return this.itemHandler.getMaxAmount(this.index, ItemStack.EMPTY);
}
@Override
public int getItemStackLimit(@Nonnull ItemStack stack) {
return Math.min(this.getSlotStackLimit(), stack.getMaxStackSize());
return Math.min(this.getSlotStackLimit(), stack.getMaxCount());
}
@Override
@@ -108,11 +108,11 @@ public class CraftingTermSlot extends AppEngCraftingSlot {
if (action == InventoryAction.CRAFT_SHIFT) // craft into player inventory...
{
ia = InventoryAdaptor.getAdaptor(who);
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxStackSize() / (double) howManyPerCraft);
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxCount() / (double) howManyPerCraft);
} else if (action == InventoryAction.CRAFT_STACK) // craft into hand, full stack
{
ia = new AdaptorFixedInv(new WrapperCursorItemHandler(who.inventory));
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxStackSize() / (double) howManyPerCraft);
maxTimesToCraft = (int) Math.floor((double) this.getStack().getMaxCount() / (double) howManyPerCraft);
} else
// pick up what was crafted...
{