Change all containers init to IContainerProvider + Add Enum for gui ids handling
This commit is contained in:
parent
b93fe6c5ad
commit
eb220643fc
114 changed files with 2155 additions and 2025 deletions
|
@ -1,7 +1,6 @@
|
|||
package techreborn.tiles.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
|
@ -24,12 +23,16 @@ import techreborn.api.Reference;
|
|||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.container.IContainerProvider;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
|
||||
public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, ISidedInventory, ITileRecipeHandler<BlastFurnaceRecipe>, IRecipeCrafterProvider {
|
||||
public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventoryProvider,
|
||||
ITileRecipeHandler<BlastFurnaceRecipe>, IRecipeCrafterProvider, IContainerProvider {
|
||||
|
||||
public static int euTick = 5;
|
||||
public int tickTime;
|
||||
|
@ -230,4 +233,12 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
|
|||
public int getCachedHeat() {
|
||||
return this.cachedHeat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(final EntityPlayer player) {
|
||||
return new ContainerBuilder("blastfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this).slot(0, 40, 25).slot(1, 40, 43).outputSlot(2, 100, 35).outputSlot(3, 118, 35)
|
||||
.syncEnergyValue().syncCrafterValue().syncIntegerValue(this::getHeat, this::setHeat).addInventory()
|
||||
.create();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package techreborn.tiles.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
|
@ -13,13 +13,15 @@ import reborncore.common.IWrenchable;
|
|||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.Inventory;
|
||||
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.client.container.IContainerProvider;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.CASING_REINFORCED;
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.ZERO_OFFSET;
|
||||
|
||||
public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, ISidedInventory, IRecipeCrafterProvider {
|
||||
public class TileImplosionCompressor extends TilePowerAcceptor
|
||||
implements IWrenchable, IInventoryProvider, IRecipeCrafterProvider, IContainerProvider {
|
||||
|
||||
public Inventory inventory = new Inventory(4, "TileImplosionCompressor", 64, this);
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
@ -27,29 +29,29 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc
|
|||
|
||||
public TileImplosionCompressor() {
|
||||
super(2);
|
||||
int[] inputs = new int[] { 0, 1 };
|
||||
int[] outputs = new int[] { 2, 3 };
|
||||
crafter = new RecipeCrafter(Reference.implosionCompressorRecipe, this, 2, 2, inventory, inputs, outputs);
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3 };
|
||||
this.crafter = new RecipeCrafter(Reference.implosionCompressorRecipe, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
multiblockChecker = new MultiblockChecker(world, getPos().down(3));
|
||||
this.multiblockChecker = new MultiblockChecker(this.world, this.getPos().down(3));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) {
|
||||
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing() {
|
||||
return getFacingEnum();
|
||||
return this.getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
|
||||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
|
@ -59,56 +61,56 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
|
||||
return new ItemStack(ModBlocks.IMPLOSION_COMPRESSOR, 1);
|
||||
}
|
||||
|
||||
public boolean getMutliBlock() {
|
||||
boolean down = multiblockChecker.checkRectY(1, 1, CASING_REINFORCED, ZERO_OFFSET);
|
||||
boolean up = multiblockChecker.checkRectY(1, 1, CASING_REINFORCED, new BlockPos(0, 2, 0));
|
||||
boolean chamber = multiblockChecker.checkRingYHollow(1, 1, CASING_REINFORCED, new BlockPos(0, 1, 0));
|
||||
final boolean down = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_REINFORCED, MultiblockChecker.ZERO_OFFSET);
|
||||
final boolean up = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_REINFORCED, new BlockPos(0, 2, 0));
|
||||
final boolean chamber = this.multiblockChecker.checkRingYHollow(1, 1, MultiblockChecker.CASING_REINFORCED, new BlockPos(0, 1, 0));
|
||||
return down && chamber && up;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
if (getMutliBlock()) {
|
||||
crafter.updateEntity();
|
||||
if (this.getMutliBlock()) {
|
||||
this.crafter.updateEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
public void readFromNBT(final NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
crafter.readFromNBT(tagCompound);
|
||||
this.crafter.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
|
||||
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
crafter.writeToNBT(tagCompound);
|
||||
this.crafter.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
public int[] getSlotsForFace(final EnumFacing side) {
|
||||
return new int[] { 0, 1, 2, 3 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
|
||||
public boolean canInsertItem(final int index, final ItemStack itemStackIn, final EnumFacing direction) {
|
||||
return index == 0 || index == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
|
||||
public boolean canExtractItem(final int index, final ItemStack stack, final EnumFacing direction) {
|
||||
return index == 2 || index == 3;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale) {
|
||||
if (crafter.currentTickTime != 0) {
|
||||
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
|
||||
public int getProgressScaled(final int scale) {
|
||||
if (this.crafter.currentTickTime != 0) {
|
||||
return this.crafter.currentTickTime * scale / this.crafter.currentNeededTicks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -119,12 +121,12 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
public boolean canAcceptEnergy(final EnumFacing direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
public boolean canProvideEnergy(final EnumFacing direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -145,12 +147,19 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc
|
|||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return crafter;
|
||||
return this.crafter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(final EntityPlayer player) {
|
||||
return new ContainerBuilder("implosioncompressor").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this).slot(0, 37, 26).slot(1, 37, 44).outputSlot(2, 93, 35).outputSlot(3, 111, 35)
|
||||
.syncEnergyValue().syncCrafterValue().addInventory().create();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package techreborn.tiles.multiblock;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -12,6 +11,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
|
@ -21,22 +21,22 @@ import reborncore.common.recipes.RecipeCrafter;
|
|||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
|
||||
import techreborn.client.container.IContainerProvider;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.CASING_NORMAL;
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.CASING_REINFORCED;
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.ZERO_OFFSET;
|
||||
|
||||
public class TileIndustrialGrinder extends TilePowerAcceptor
|
||||
implements IWrenchable, IInventoryProvider, ISidedInventory, ITileRecipeHandler<IndustrialGrinderRecipe>, IRecipeCrafterProvider {
|
||||
public class TileIndustrialGrinder extends TilePowerAcceptor implements IWrenchable, IInventoryProvider,
|
||||
ITileRecipeHandler<IndustrialGrinderRecipe>, IRecipeCrafterProvider, IContainerProvider {
|
||||
public static final int TANK_CAPACITY = 16000;
|
||||
|
||||
public Inventory inventory = new Inventory(6, "TileGrinder", 64, this);
|
||||
public Tank tank = new Tank("TileGrinder", TANK_CAPACITY, this);
|
||||
public Tank tank = new Tank("TileGrinder", TileIndustrialGrinder.TANK_CAPACITY, this);
|
||||
public RecipeCrafter crafter;
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
||||
|
@ -44,29 +44,30 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
super(ConfigTechReborn.CentrifugeTier);
|
||||
// TODO configs
|
||||
|
||||
int[] inputs = new int[2];
|
||||
final int[] inputs = new int[2];
|
||||
inputs[0] = 0;
|
||||
inputs[1] = 1;
|
||||
int[] outputs = new int[4];
|
||||
final int[] outputs = new int[4];
|
||||
outputs[0] = 2;
|
||||
outputs[1] = 3;
|
||||
outputs[2] = 4;
|
||||
outputs[3] = 5;
|
||||
crafter = new RecipeCrafter(Reference.industrialGrinderRecipe, this, 1, 4, inventory, inputs, outputs);
|
||||
this.crafter = new RecipeCrafter(Reference.industrialGrinderRecipe, this, 1, 4, this.inventory, inputs,
|
||||
outputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) {
|
||||
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing() {
|
||||
return getFacingEnum();
|
||||
return this.getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
|
||||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
|
@ -76,16 +77,19 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
|
||||
return new ItemStack(ModBlocks.INDUSTRIAL_GRINDER, 1);
|
||||
}
|
||||
|
||||
public boolean getMutliBlock() {
|
||||
boolean down = multiblockChecker.checkRectY(1, 1, CASING_NORMAL, ZERO_OFFSET);
|
||||
boolean up = multiblockChecker.checkRectY(1, 1, CASING_NORMAL, new BlockPos(0, 2, 0));
|
||||
boolean blade = multiblockChecker.checkRingY(1, 1, CASING_REINFORCED, new BlockPos(0, 1, 0));
|
||||
IBlockState centerBlock = multiblockChecker.getBlock(0, 1, 0);
|
||||
boolean center = centerBlock.getBlock() == Blocks.WATER;
|
||||
final boolean down = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_NORMAL,
|
||||
MultiblockChecker.ZERO_OFFSET);
|
||||
final boolean up = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_NORMAL,
|
||||
new BlockPos(0, 2, 0));
|
||||
final boolean blade = this.multiblockChecker.checkRingY(1, 1, MultiblockChecker.CASING_REINFORCED,
|
||||
new BlockPos(0, 1, 0));
|
||||
final IBlockState centerBlock = this.multiblockChecker.getBlock(0, 1, 0);
|
||||
final boolean center = centerBlock.getBlock() == Blocks.WATER;
|
||||
return down && center && blade && up;
|
||||
}
|
||||
|
||||
|
@ -93,29 +97,29 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
public void update() {
|
||||
super.update();
|
||||
|
||||
if (multiblockChecker == null) {
|
||||
BlockPos pos = getPos().offset(getFacing().getOpposite(), 2).down();
|
||||
multiblockChecker = new MultiblockChecker(world, pos);
|
||||
if (this.multiblockChecker == null) {
|
||||
final BlockPos pos = this.getPos().offset(this.getFacing().getOpposite(), 2).down();
|
||||
this.multiblockChecker = new MultiblockChecker(this.world, pos);
|
||||
}
|
||||
|
||||
if (getMutliBlock()) {
|
||||
crafter.updateEntity();
|
||||
if (this.getMutliBlock()) {
|
||||
this.crafter.updateEntity();
|
||||
}
|
||||
FluidUtils.drainContainers(tank, inventory, 1, 5);
|
||||
FluidUtils.drainContainers(this.tank, this.inventory, 1, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
public void readFromNBT(final NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
tank.readFromNBT(tagCompound);
|
||||
crafter.readFromNBT(tagCompound);
|
||||
this.tank.readFromNBT(tagCompound);
|
||||
this.crafter.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
|
||||
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tank.writeToNBT(tagCompound);
|
||||
crafter.writeToNBT(tagCompound);
|
||||
this.tank.writeToNBT(tagCompound);
|
||||
this.crafter.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
|
@ -130,7 +134,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
public boolean hasCapability(final Capability<?> capability, final EnumFacing facing) {
|
||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
|
||||
return true;
|
||||
}
|
||||
|
@ -138,34 +142,34 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
public <T> T getCapability(final Capability<T> capability, final EnumFacing facing) {
|
||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
|
||||
return (T) tank;
|
||||
return (T) this.tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
// ISidedInventory
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
public int[] getSlotsForFace(final EnumFacing side) {
|
||||
return side == EnumFacing.DOWN ? new int[] { 0, 1, 2, 3, 4, 5 } : new int[] { 0, 1, 2, 3, 4, 5 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slotIndex, ItemStack itemStack, EnumFacing side) {
|
||||
public boolean canInsertItem(final int slotIndex, final ItemStack itemStack, final EnumFacing side) {
|
||||
if (slotIndex >= 2)
|
||||
return false;
|
||||
return isItemValidForSlot(slotIndex, itemStack);
|
||||
return this.isItemValidForSlot(slotIndex, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slotIndex, ItemStack itemStack, EnumFacing side) {
|
||||
public boolean canExtractItem(final int slotIndex, final ItemStack itemStack, final EnumFacing side) {
|
||||
return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale) {
|
||||
if (crafter.currentTickTime != 0) {
|
||||
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
|
||||
public int getProgressScaled(final int scale) {
|
||||
if (this.crafter.currentTickTime != 0) {
|
||||
return this.crafter.currentTickTime * scale / this.crafter.currentNeededTicks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -176,12 +180,12 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
public boolean canAcceptEnergy(final EnumFacing direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
public boolean canProvideEnergy(final EnumFacing direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -201,9 +205,9 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile, IndustrialGrinderRecipe recipe) {
|
||||
FluidStack recipeFluid = recipe.fluidStack;
|
||||
FluidStack tankFluid = tank.getFluid();
|
||||
public boolean canCraft(final TileEntity tile, final IndustrialGrinderRecipe recipe) {
|
||||
final FluidStack recipeFluid = recipe.fluidStack;
|
||||
final FluidStack tankFluid = this.tank.getFluid();
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
|
@ -219,9 +223,9 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile, IndustrialGrinderRecipe recipe) {
|
||||
FluidStack recipeFluid = recipe.fluidStack;
|
||||
FluidStack tankFluid = tank.getFluid();
|
||||
public boolean onCraft(final TileEntity tile, final IndustrialGrinderRecipe recipe) {
|
||||
final FluidStack recipeFluid = recipe.fluidStack;
|
||||
final FluidStack tankFluid = this.tank.getFluid();
|
||||
if (recipe.fluidStack == null) {
|
||||
return true;
|
||||
}
|
||||
|
@ -231,7 +235,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
if (tankFluid.isFluidEqual(recipeFluid)) {
|
||||
if (tankFluid.amount >= recipeFluid.amount) {
|
||||
if (tankFluid.amount == recipeFluid.amount)
|
||||
tank.setFluid(null);
|
||||
this.tank.setFluid(null);
|
||||
else
|
||||
tankFluid.amount -= recipeFluid.amount;
|
||||
return true;
|
||||
|
@ -242,12 +246,20 @@ public class TileIndustrialGrinder extends TilePowerAcceptor
|
|||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return crafter;
|
||||
return this.crafter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(final EntityPlayer player) {
|
||||
return new ContainerBuilder("industrialgrinder").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this).slot(0, 32, 26).slot(1, 32, 44).outputSlot(2, 77, 35).outputSlot(3, 95, 35)
|
||||
.outputSlot(4, 113, 35).outputSlot(5, 131, 35).syncEnergyValue().syncCrafterValue().addInventory()
|
||||
.create();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -12,7 +11,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.IWrenchable;
|
||||
|
@ -20,16 +19,17 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
|||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
|
||||
import techreborn.client.container.IContainerProvider;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.items.ItemDusts;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.CASING_NORMAL;
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.CASING_REINFORCED;
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.ZERO_OFFSET;
|
||||
|
||||
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, ISidedInventory, IListInfoProvider {
|
||||
public class TileIndustrialSawmill extends TilePowerAcceptor
|
||||
implements IWrenchable, IInventoryProvider, IContainerProvider {
|
||||
|
||||
public Inventory inventory = new Inventory(5, "Sawmill", 64, this);
|
||||
public Tank tank = new Tank("Sawmill", 16000, this);
|
||||
|
@ -44,83 +44,84 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
if (getMutliBlock()) {
|
||||
ItemStack wood = inventory.getStackInSlot(0);
|
||||
if (tickTime == 0) {
|
||||
if (wood != null) {
|
||||
for (int id : OreDictionary.getOreIDs(wood)) {
|
||||
String name = OreDictionary.getOreName(id);
|
||||
if (name.equals("logWood") &&
|
||||
canAddOutput(2, 10) &&
|
||||
canAddOutput(3, 5) &&
|
||||
canAddOutput(4, 3) &&
|
||||
canUseEnergy(128.0F) &&
|
||||
!tank.isEmpty() &&
|
||||
tank.getFluid().amount >= 1000) {
|
||||
|
||||
if (this.getMutliBlock()) {
|
||||
final ItemStack wood = this.inventory.getStackInSlot(0);
|
||||
if (this.tickTime == 0) {
|
||||
if (!wood.isEmpty()) {
|
||||
for (final int id : OreDictionary.getOreIDs(wood)) {
|
||||
final String name = OreDictionary.getOreName(id);
|
||||
if (name.equals("logWood") && this.canAddOutput(2, 10) && this.canAddOutput(3, 5)
|
||||
&& this.canAddOutput(4, 3) && this.canUseEnergy(128.0F) && !this.tank.isEmpty()
|
||||
&& this.tank.getFluid().amount >= 1000) {
|
||||
wood.shrink(1);
|
||||
if (wood.getCount() == 0)
|
||||
setInventorySlotContents(0, ItemStack.EMPTY);
|
||||
tank.drain(1000, true);
|
||||
useEnergy(128.0F);
|
||||
tickTime = 1;
|
||||
this.setInventorySlotContents(0, ItemStack.EMPTY);
|
||||
this.tank.drain(1000, true);
|
||||
this.useEnergy(128.0F);
|
||||
this.syncWithAll();
|
||||
this.tickTime = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (++tickTime > 100) {
|
||||
Random rnd = world.rand;
|
||||
addOutput(2, new ItemStack(Blocks.PLANKS, 6 + rnd.nextInt(4)));
|
||||
} else if (++this.tickTime > 100) {
|
||||
final Random rnd = this.world.rand;
|
||||
this.addOutput(2, new ItemStack(Blocks.PLANKS, 6 + rnd.nextInt(4)));
|
||||
if (rnd.nextInt(4) != 0) {
|
||||
ItemStack pulp = ItemDusts.getDustByName("sawDust", 2 + rnd.nextInt(3));
|
||||
addOutput(3, pulp);
|
||||
final ItemStack pulp = ItemDusts.getDustByName("sawDust", 2 + rnd.nextInt(3));
|
||||
this.addOutput(3, pulp);
|
||||
}
|
||||
if (rnd.nextInt(3) == 0) {
|
||||
ItemStack paper = new ItemStack(Items.PAPER, 1 + rnd.nextInt(2));
|
||||
addOutput(4, paper);
|
||||
final ItemStack paper = new ItemStack(Items.PAPER, 1 + rnd.nextInt(2));
|
||||
this.addOutput(4, paper);
|
||||
}
|
||||
tickTime = 0;
|
||||
this.tickTime = 0;
|
||||
}
|
||||
}
|
||||
FluidUtils.drainContainers(tank, inventory, 1, 4);
|
||||
FluidUtils.drainContainers(this.tank, this.inventory, 1, 4);
|
||||
}
|
||||
|
||||
public void addOutput(int slot, ItemStack stack) {
|
||||
if (getStackInSlot(slot) == ItemStack.EMPTY)
|
||||
setInventorySlotContents(slot, stack);
|
||||
getStackInSlot(slot).grow(stack.getCount());
|
||||
public void addOutput(final int slot, final ItemStack stack) {
|
||||
if (this.getStackInSlot(slot) == ItemStack.EMPTY)
|
||||
this.setInventorySlotContents(slot, stack);
|
||||
this.getStackInSlot(slot).grow(stack.getCount());
|
||||
}
|
||||
|
||||
public boolean canAddOutput(int slot, int amount) {
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
return stack == ItemStack.EMPTY || getInventoryStackLimit() - stack.getCount() >= amount;
|
||||
public boolean canAddOutput(final int slot, final int amount) {
|
||||
final ItemStack stack = this.getStackInSlot(slot);
|
||||
return stack == ItemStack.EMPTY || this.getInventoryStackLimit() - stack.getCount() >= amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
multiblockChecker = new MultiblockChecker(world, getPos().down(3));
|
||||
this.multiblockChecker = new MultiblockChecker(this.world, this.getPos().down(3));
|
||||
}
|
||||
|
||||
public boolean getMutliBlock() {
|
||||
boolean down = multiblockChecker.checkRectY(1, 1, CASING_NORMAL, ZERO_OFFSET);
|
||||
boolean up = multiblockChecker.checkRectY(1, 1, CASING_NORMAL, new BlockPos(0, 2, 0));
|
||||
boolean blade = multiblockChecker.checkRingY(1, 1, CASING_REINFORCED, new BlockPos(0, 1, 0));
|
||||
IBlockState centerBlock = multiblockChecker.getBlock(0, 1, 0);
|
||||
boolean center = centerBlock.getBlock() == Blocks.WATER;
|
||||
final boolean down = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_NORMAL,
|
||||
MultiblockChecker.ZERO_OFFSET);
|
||||
final boolean up = this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_NORMAL,
|
||||
new BlockPos(0, 2, 0));
|
||||
final boolean blade = this.multiblockChecker.checkRingY(1, 1, MultiblockChecker.CASING_REINFORCED,
|
||||
new BlockPos(0, 1, 0));
|
||||
final IBlockState centerBlock = this.multiblockChecker.getBlock(0, 1, 0);
|
||||
final boolean center = centerBlock.getBlock() == Blocks.WATER;
|
||||
return down && center && blade && up;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) {
|
||||
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing() {
|
||||
return getFacingEnum();
|
||||
return this.getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
|
||||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
|
@ -130,27 +131,27 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
|
||||
return new ItemStack(ModBlocks.INDUSTRIAL_SAWMILL, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
public void readFromNBT(final NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
tank.readFromNBT(tagCompound);
|
||||
tickTime = tagCompound.getInteger("tickTime");
|
||||
this.tank.readFromNBT(tagCompound);
|
||||
this.tickTime = tagCompound.getInteger("tickTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
|
||||
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tank.writeToNBT(tagCompound);
|
||||
tagCompound.setInteger("tickTime", tickTime);
|
||||
this.tank.writeToNBT(tagCompound);
|
||||
tagCompound.setInteger("tickTime", this.tickTime);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability(Capability<?> capability, EnumFacing facing) {
|
||||
public boolean hasCapability(final Capability<?> capability, final EnumFacing facing) {
|
||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
|
||||
return true;
|
||||
}
|
||||
|
@ -158,31 +159,31 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
public <T> T getCapability(final Capability<T> capability, final EnumFacing facing) {
|
||||
if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
|
||||
return (T) tank;
|
||||
return (T) this.tank;
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
public int[] getSlotsForFace(final EnumFacing side) {
|
||||
return new int[] { 0, 2, 3, 4, 5 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
|
||||
public boolean canInsertItem(final int index, final ItemStack itemStackIn, final EnumFacing direction) {
|
||||
return index == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
|
||||
public boolean canExtractItem(final int index, final ItemStack stack, final EnumFacing direction) {
|
||||
return index >= 2;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale) {
|
||||
if (tickTime != 0) {
|
||||
return tickTime * scale / 100;
|
||||
public int getProgressScaled(final int scale) {
|
||||
if (this.tickTime != 0) {
|
||||
return this.tickTime * scale / 100;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -193,12 +194,12 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
public boolean canAcceptEnergy(final EnumFacing direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
public boolean canProvideEnergy(final EnumFacing direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -219,7 +220,13 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(final EntityPlayer player) {
|
||||
return new ContainerBuilder("industrialsawmill").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this).slot(0, 32, 26).slot(1, 32, 44).outputSlot(2, 84, 35).outputSlot(3, 102, 35)
|
||||
.outputSlot(4, 120, 35).syncEnergyValue().addInventory().create();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package techreborn.tiles.multiblock;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.recipe.IRecipeCrafterProvider;
|
||||
import reborncore.api.tile.IInventoryProvider;
|
||||
|
@ -12,13 +12,15 @@ import reborncore.common.IWrenchable;
|
|||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.Inventory;
|
||||
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.client.container.IContainerProvider;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.CASING_REINFORCED;
|
||||
import static techreborn.tiles.multiblock.MultiblockChecker.ZERO_OFFSET;
|
||||
|
||||
public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable, IInventoryProvider, IRecipeCrafterProvider, ISidedInventory {
|
||||
public class TileVacuumFreezer extends TilePowerAcceptor
|
||||
implements IWrenchable, IInventoryProvider, IRecipeCrafterProvider, IContainerProvider {
|
||||
|
||||
public Inventory inventory = new Inventory(3, "TileVacuumFreezer", 64, this);
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
@ -26,26 +28,26 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
|
||||
public TileVacuumFreezer() {
|
||||
super(2);
|
||||
int[] inputs = new int[] { 0 };
|
||||
int[] outputs = new int[] { 1 };
|
||||
crafter = new RecipeCrafter(Reference.vacuumFreezerRecipe, this, 2, 1, inventory, inputs, outputs);
|
||||
final int[] inputs = new int[] { 0 };
|
||||
final int[] outputs = new int[] { 1 };
|
||||
this.crafter = new RecipeCrafter(Reference.vacuumFreezerRecipe, this, 2, 1, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
super.validate();
|
||||
multiblockChecker = new MultiblockChecker(world, getPos().down());
|
||||
this.multiblockChecker = new MultiblockChecker(this.world, this.getPos().down());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
if (getMultiBlock())
|
||||
crafter.updateEntity();
|
||||
if (this.getMultiBlock())
|
||||
this.crafter.updateEntity();
|
||||
}
|
||||
|
||||
public boolean getMultiBlock() {
|
||||
return multiblockChecker.checkRectY(1, 1, CASING_REINFORCED, ZERO_OFFSET);
|
||||
return this.multiblockChecker.checkRectY(1, 1, MultiblockChecker.CASING_REINFORCED, MultiblockChecker.ZERO_OFFSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,12 +56,12 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
public boolean canAcceptEnergy(final EnumFacing direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
public boolean canProvideEnergy(final EnumFacing direction) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -79,17 +81,17 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) {
|
||||
public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final EnumFacing side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing() {
|
||||
return getFacingEnum();
|
||||
return this.getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
public boolean wrenchCanRemove(final EntityPlayer entityPlayer) {
|
||||
return entityPlayer.isSneaking();
|
||||
}
|
||||
|
||||
|
@ -99,53 +101,60 @@ public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable,
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) {
|
||||
return new ItemStack(ModBlocks.ALLOY_SMELTER, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
public void readFromNBT(final NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
crafter.readFromNBT(tagCompound);
|
||||
this.crafter.readFromNBT(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
|
||||
public NBTTagCompound writeToNBT(final NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
crafter.writeToNBT(tagCompound);
|
||||
this.crafter.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int scale) {
|
||||
if (crafter.currentTickTime != 0) {
|
||||
return crafter.currentTickTime * scale / crafter.currentNeededTicks;
|
||||
public int getProgressScaled(final int scale) {
|
||||
if (this.crafter.currentTickTime != 0) {
|
||||
return this.crafter.currentTickTime * scale / this.crafter.currentNeededTicks;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecipeCrafter getRecipeCrafter() {
|
||||
return crafter;
|
||||
return this.crafter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getSlotsForFace(EnumFacing side) {
|
||||
public int[] getSlotsForFace(final EnumFacing side) {
|
||||
return new int[] { 0, 1 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int index, ItemStack itemStackIn, EnumFacing direction) {
|
||||
public boolean canInsertItem(final int index, final ItemStack itemStackIn, final EnumFacing direction) {
|
||||
return index == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction) {
|
||||
public boolean canExtractItem(final int index, final ItemStack stack, final EnumFacing direction) {
|
||||
return index == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuiltContainer createContainer(final EntityPlayer player) {
|
||||
return new ContainerBuilder("vacuumfreezer").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this).slot(0, 56, 34).outputSlot(1, 116, 35).syncEnergyValue().syncCrafterValue()
|
||||
.addInventory().create();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue