Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private boolean canSmelt()
- {
- if (this.furnaceItemStacks[0] == null && this.furnaceItemStacks[3] == null && this.furnaceItemStacks[4] == null)
- {
- return false;
- }
- else
- {
- ItemStack itemstack = MaskForgeRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0], this.furnaceItemStacks[3], this.furnaceItemStacks[4]);//TODO
- if (itemstack == null) return false;
- if (this.furnaceItemStacks[2] == null) return true;
- if (!this.furnaceItemStacks[2].isItemEqual(itemstack)) return false;
- int result = furnaceItemStacks[2].stackSize + itemstack.stackSize;
- return (result <= getInventoryStackLimit() && result <= itemstack.getMaxStackSize());
- }
- }
- /**
- * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack
- */
- public void smeltItem()
- {
- if (this.canSmelt())
- {
- ItemStack itemstack = MaskForgeRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0], this.furnaceItemStacks[3], this.furnaceItemStacks[4]);//TODO
- if (this.furnaceItemStacks[2] == null)
- {
- this.furnaceItemStacks[2] = itemstack.copy();
- }
- else if (this.furnaceItemStacks[2].isItemEqual(itemstack))
- {
- furnaceItemStacks[2].stackSize += itemstack.stackSize;
- }
- --this.furnaceItemStacks[0].stackSize;
- if (this.furnaceItemStacks[0].stackSize <= 0)
- {
- this.furnaceItemStacks[0] = null;
- }
- --this.furnaceItemStacks[3].stackSize;
- if (this.furnaceItemStacks[3].stackSize <= 0)
- {
- this.furnaceItemStacks[3] = null;
- }
- --this.furnaceItemStacks[4].stackSize;
- if (this.furnaceItemStacks[4].stackSize <= 0)
- {
- this.furnaceItemStacks[4] = null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement