Merge remote-tracking branch 'origin/master'

This commit is contained in:
Tntrololol 2015-06-08 21:01:55 -05:00
commit dd181dca2f
8 changed files with 441 additions and 15 deletions

View file

@ -4,15 +4,18 @@ import ic2.api.energy.prefab.BasicSink;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
import java.util.List;
public class TileChemicalReactor extends TileMachineBase implements IWrenchable, IEnergyTile {
public class TileChemicalReactor extends TileMachineBase implements IWrenchable, IEnergyTile , IInventory, ISidedInventory{
public int tickTime;
public BasicSink energy;
@ -115,6 +118,87 @@ public class TileChemicalReactor extends TileMachineBase implements IWrenchable,
super.onChunkUnload();
}
@Override
public int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int slot) {
return inventory.getStackInSlot(slot);
}
@Override
public ItemStack decrStackSize(int slot, int amount) {
return inventory.decrStackSize(slot, amount);
}
@Override
public ItemStack getStackInSlotOnClosing(int slot) {
return inventory.getStackInSlotOnClosing(slot);
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
inventory.setInventorySlotContents(slot, stack);
}
@Override
public String getInventoryName() {
return inventory.getInventoryName();
}
@Override
public boolean hasCustomInventoryName() {
return inventory.hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit() {
return inventory.getInventoryStackLimit();
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if (slotIndex == 2)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 2;
}
// @Override
// public void addWailaInfo(List<String> info)
// {

View file

@ -5,6 +5,7 @@ import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
@ -17,7 +18,7 @@ import techreborn.util.FluidUtils;
import techreborn.util.Inventory;
import techreborn.util.Tank;
public class TileGrinder extends TileMachineBase implements IWrenchable, IEnergyTile, IFluidHandler, IInventory {
public class TileGrinder extends TileMachineBase implements IWrenchable, IEnergyTile, IFluidHandler, IInventory, ISidedInventory {
public int tickTime;
public BasicSink energy;
@ -219,4 +220,25 @@ public class TileGrinder extends TileMachineBase implements IWrenchable, IEnergy
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if (slotIndex >= 2)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5;
}
}

View file

@ -5,15 +5,17 @@ import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
import java.util.List;
public class TileImplosionCompressor extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory {
public class TileImplosionCompressor extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public int tickTime;
public BasicSink energy;
@ -179,4 +181,25 @@ public class TileImplosionCompressor extends TileMachineBase implements IWrencha
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if (slotIndex >= 2)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 2 || slotIndex == 3;
}
}

View file

@ -4,15 +4,18 @@ import ic2.api.energy.prefab.BasicSink;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
import java.util.List;
public class TileIndustrialElectrolyzer extends TileMachineBase implements IWrenchable, IEnergyTile {
public class TileIndustrialElectrolyzer extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public int tickTime;
public BasicSink energy;
@ -113,15 +116,95 @@ public class TileIndustrialElectrolyzer extends TileMachineBase implements IWren
super.onChunkUnload();
}
// @Override
// public void addWailaInfo(List<String> info)
// {
// super.addWailaInfo(info);
// info.add("Power Stored " + energy.getEnergyStored() +" EU");
// if(crafter.currentRecipe !=null){
// info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
// }
// }
@Override
public void addWailaInfo(List<String> info)
{
super.addWailaInfo(info);
info.add("Power Stored " + energy.getEnergyStored() +" EU");
if(crafter.currentRecipe !=null){
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
}
public int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int slot) {
return inventory.getStackInSlot(slot);
}
@Override
public ItemStack decrStackSize(int slot, int amount) {
return inventory.decrStackSize(slot, amount);
}
@Override
public ItemStack getStackInSlotOnClosing(int slot) {
return inventory.getStackInSlotOnClosing(slot);
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
inventory.setInventorySlotContents(slot, stack);
}
@Override
public String getInventoryName() {
return inventory.getInventoryName();
}
@Override
public boolean hasCustomInventoryName() {
return inventory.hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit() {
return inventory.getInventoryStackLimit();
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if(slotIndex >= 1)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 2 || slotIndex == 3 || slotIndex == 4 || slotIndex == 5;
}
}

View file

@ -5,15 +5,17 @@ import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
import java.util.List;
public class TileIndustrialSawmill extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory {
public class TileIndustrialSawmill extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public int tickTime;
public BasicSink energy;
@ -187,5 +189,26 @@ public class TileIndustrialSawmill extends TileMachineBase implements IWrenchabl
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4} : new int[]{0, 1, 2, 3, 4};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if (slotIndex >= 2)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 2 || slotIndex == 3 || slotIndex == 4;
}
}

View file

@ -4,15 +4,18 @@ import ic2.api.energy.prefab.BasicSink;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
import java.util.List;
public class TileLathe extends TileMachineBase implements IWrenchable, IEnergyTile {
public class TileLathe extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public int tickTime;
public BasicSink energy;
@ -114,6 +117,87 @@ public class TileLathe extends TileMachineBase implements IWrenchable, IEnergyTi
super.onChunkUnload();
}
@Override
public int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int slot) {
return inventory.getStackInSlot(slot);
}
@Override
public ItemStack decrStackSize(int slot, int amount) {
return inventory.decrStackSize(slot, amount);
}
@Override
public ItemStack getStackInSlotOnClosing(int slot) {
return inventory.getStackInSlotOnClosing(slot);
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
inventory.setInventorySlotContents(slot, stack);
}
@Override
public String getInventoryName() {
return inventory.getInventoryName();
}
@Override
public boolean hasCustomInventoryName() {
return inventory.hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit() {
return inventory.getInventoryStackLimit();
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1} : new int[]{0, 1};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if (slotIndex == 1)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 1;
}
// @Override
// public void addWailaInfo(List<String> info)
// {

View file

@ -5,13 +5,15 @@ import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
public class TileMatterFabricator extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory {
public class TileMatterFabricator extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public int tickTime;
public BasicSink energy;
@ -156,5 +158,26 @@ public class TileMatterFabricator extends TileMachineBase implements IWrenchable
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5, 6} : new int[]{0, 1, 2, 3, 4, 5, 6};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if (slotIndex == 6)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 6;
}
}

View file

@ -4,15 +4,18 @@ import ic2.api.energy.prefab.BasicSink;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.init.ModBlocks;
import techreborn.util.Inventory;
import java.util.List;
public class TilePlateCuttingMachine extends TileMachineBase implements IWrenchable, IEnergyTile {
public class TilePlateCuttingMachine extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public int tickTime;
public BasicSink energy;
@ -123,6 +126,87 @@ public class TilePlateCuttingMachine extends TileMachineBase implements IWrencha
energy.onChunkUnload();
super.onChunkUnload();
}
@Override
public int getSizeInventory() {
return inventory.getSizeInventory();
}
@Override
public ItemStack getStackInSlot(int slot) {
return inventory.getStackInSlot(slot);
}
@Override
public ItemStack decrStackSize(int slot, int amount) {
return inventory.decrStackSize(slot, amount);
}
@Override
public ItemStack getStackInSlotOnClosing(int slot) {
return inventory.getStackInSlotOnClosing(slot);
}
@Override
public void setInventorySlotContents(int slot, ItemStack stack) {
inventory.setInventorySlotContents(slot, stack);
}
@Override
public String getInventoryName() {
return inventory.getInventoryName();
}
@Override
public boolean hasCustomInventoryName() {
return inventory.hasCustomInventoryName();
}
@Override
public int getInventoryStackLimit() {
return inventory.getInventoryStackLimit();
}
@Override
public boolean isUseableByPlayer(EntityPlayer player) {
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
}
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side)
{
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1} : new int[]{0, 1};
}
@Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{
if (slotIndex == 1)
return false;
return isItemValidForSlot(slotIndex, itemStack);
}
@Override
public boolean canExtractItem(int slotIndex, ItemStack itemStack, int side)
{
return slotIndex == 1;
}
}