Added Isided to Centrifuge

Fixed Isided on other machines
This commit is contained in:
Gig 2015-06-08 23:11:48 +01:00
parent f005ba2ec7
commit 4e9546431d
4 changed files with 33 additions and 4 deletions

View file

@ -180,12 +180,14 @@ public class TileAlloySmelter extends TileMachineBase implements IWrenchable, IE
@Override @Override
public int[] getAccessibleSlotsFromSide(int side) public int[] getAccessibleSlotsFromSide(int side)
{ {
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1} : new int[]{0, 1}; return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
} }
@Override @Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side) public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{ {
if (slotIndex == 2)
return false;
return isItemValidForSlot(slotIndex, itemStack); return isItemValidForSlot(slotIndex, itemStack);
} }

View file

@ -182,12 +182,14 @@ public class TileAssemblingMachine extends TileMachineBase implements IWrenchabl
@Override @Override
public int[] getAccessibleSlotsFromSide(int side) public int[] getAccessibleSlotsFromSide(int side)
{ {
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1} : new int[]{0, 1}; return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
} }
@Override @Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side) public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{ {
if (slotIndex == 2)
return false;
return isItemValidForSlot(slotIndex, itemStack); return isItemValidForSlot(slotIndex, itemStack);
} }

View file

@ -294,12 +294,14 @@ public class TileBlastFurnace extends TileMachineBase implements IWrenchable, II
@Override @Override
public int[] getAccessibleSlotsFromSide(int side) public int[] getAccessibleSlotsFromSide(int side)
{ {
return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1} : new int[]{0, 1}; return side == ForgeDirection.DOWN.ordinal() ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3};
} }
@Override @Override
public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side) public boolean canInsertItem(int slotIndex, ItemStack itemStack, int side)
{ {
if (slotIndex >= 1)
return false;
return isItemValidForSlot(slotIndex, itemStack); return isItemValidForSlot(slotIndex, itemStack);
} }

View file

@ -5,8 +5,10 @@ import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable; import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.api.recipe.RecipeCrafter; import techreborn.api.recipe.RecipeCrafter;
import techreborn.config.ConfigTechReborn; import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
@ -14,7 +16,7 @@ import techreborn.util.Inventory;
import java.util.List; import java.util.List;
public class TileCentrifuge extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory{ public class TileCentrifuge extends TileMachineBase implements IWrenchable, IEnergyTile, IInventory, ISidedInventory{
public int tickTime; public int tickTime;
public BasicSink energy; public BasicSink energy;
@ -193,4 +195,25 @@ public class TileCentrifuge extends TileMachineBase implements IWrenchable, IEn
public boolean isItemValidForSlot(int slot, ItemStack stack) { public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, 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;
}
} }