This commit is contained in:
ProfessorProspector 2016-12-12 15:44:33 -08:00
commit de5ebf5ae3
2 changed files with 30 additions and 2 deletions

View file

@ -388,7 +388,7 @@ public class ModRecipes {
ItemParts.getPartByName("rubber", 3), 400, 2));
RecipeHandler.addRecipe(
new ExtractorRecipe(new ItemStack(ModBlocks.rubberLog),
ItemParts.getPartByName("rubber"), 400, 2, true));
ItemParts.getPartByName("rubber"), 400, 2, false));
}
static void addIc2ReplacementReicpes() {

View file

@ -1,15 +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.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);
@ -135,4 +143,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;
}
}