Partial progress on pattern slot.

This commit is contained in:
AlgorithmX2
2014-04-10 22:43:18 -05:00
parent 2de3ab4505
commit e20f26fc6d
3 changed files with 90 additions and 41 deletions
+27 -7
View File
@@ -3,24 +3,44 @@ package appeng.container.slot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import appeng.api.networking.energy.IEnergySource;
import appeng.api.networking.security.BaseActionSource;
import appeng.api.storage.IStorageMonitorable;
public class SlotPatternTerm extends OptionalSlotFake
public class SlotPatternTerm extends SlotCraftingTerm
{
public SlotPatternTerm(IInventory inv, IOptionalSlotHost h, int idx, int x, int y, int grpnum) {
super( inv, h, idx, x, y, 0, 0, grpnum );
int groupNum;
IOptionalSlotHost host;
public SlotPatternTerm(EntityPlayer player, BaseActionSource mySrc, IEnergySource energySrc, IStorageMonitorable storage, IInventory cMatrix,
IInventory secondMatrix, IInventory output, int x, int y, IOptionalSlotHost h, int grpnum) {
super( player, mySrc, energySrc, storage, cMatrix, secondMatrix, output, x, y );
host = h;
groupNum = grpnum;
}
@Override
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
public ItemStack getStack()
{
return super.canTakeStack( par1EntityPlayer );
if ( !isEnabled() )
{
if ( getDisplayStack() != null )
clearStack();
}
return super.getStack();
}
@Override
public void onPickupFromSlot(EntityPlayer p, ItemStack is)
public boolean isEnabled()
{
super.onPickupFromSlot( p, is );
if ( host == null )
return false;
return host.isSlotEnabled( groupNum );
}
}