Iron furnace now uses the same sides as the vanilla furnace, closes #622
This commit is contained in:
parent
7426f4e3ed
commit
71d8a3c7e8
1 changed files with 29 additions and 2 deletions
|
@ -1,16 +1,23 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.tile.TileLegacyMachineBase;
|
||||
import reborncore.common.tile.TileMachineBase;
|
||||
import reborncore.common.util.Inventory;
|
||||
|
||||
public class TileIronFurnace extends TileLegacyMachineBase implements IInventoryProvider {
|
||||
public class TileIronFurnace extends TileLegacyMachineBase implements IInventoryProvider, ISidedInventory {
|
||||
|
||||
private static final int[] SLOTS_TOP = new int[] { 0 };
|
||||
private static final int[] SLOTS_BOTTOM = new int[] { 2, 1 };
|
||||
private static final int[] SLOTS_SIDES = new int[] { 1 };
|
||||
|
||||
public int tickTime;
|
||||
public Inventory inventory = new Inventory(3, "TileIronFurnace", 64, this);
|
||||
|
@ -137,4 +144,24 @@ public class TileIronFurnace extends TileLegacyMachineBase implements IInventory
|
|||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
return side == EnumFacing.DOWN ? SLOTS_BOTTOM : (side == EnumFacing.UP ? SLOTS_TOP : SLOTS_SIDES);
|
||||
}
|
||||
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
|
||||
return this.isItemValidForSlot(index, itemStackIn);
|
||||
}
|
||||
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
|
||||
if (direction == EnumFacing.DOWN && index == 1) {
|
||||
Item item = stack.getItem();
|
||||
|
||||
if (item != Items.WATER_BUCKET && item != Items.BUCKET) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue