More Pattern Terminal Stuff.
This commit is contained in:
parent
2ebca04296
commit
0cec53eece
6 changed files with 30 additions and 8 deletions
|
@ -19,7 +19,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
|||
public void initGui()
|
||||
{
|
||||
super.initGui();
|
||||
buttonList.add( clearBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.CLOSE ) );
|
||||
buttonList.add( clearBtn = new GuiImgButton( this.guiLeft + 32, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.PULL ) );
|
||||
buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 92, this.guiTop + this.ySize - 156, Settings.ACTIONS, ActionItems.CLOSE ) );
|
||||
clearBtn.halfSize = true;
|
||||
}
|
||||
|
|
|
@ -156,6 +156,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
|||
|
||||
registerApp( 66, Settings.ACTIONS, ActionItems.WRENCH, ButtonToolTips.PartitionStorage, ButtonToolTips.PartitionStorageHint );
|
||||
registerApp( 6, Settings.ACTIONS, ActionItems.CLOSE, ButtonToolTips.Clear, ButtonToolTips.ClearSettings );
|
||||
registerApp( 7, Settings.ACTIONS, ActionItems.PULL, ButtonToolTips.Pull, ButtonToolTips.PullDescription );
|
||||
|
||||
registerApp( 16, Settings.VIEW_MODE, ViewItems.STORED, ButtonToolTips.View, ButtonToolTips.StoredItems );
|
||||
registerApp( 18, Settings.VIEW_MODE, ViewItems.ALL, ButtonToolTips.View, ButtonToolTips.StoredCraftable );
|
||||
|
|
|
@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack;
|
|||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.container.slot.SlotFake;
|
||||
import appeng.container.slot.SlotPatternTerm;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
|
||||
import appeng.parts.reporting.PartPatternTerminal;
|
||||
import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
|
@ -19,6 +21,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
|||
SlotFake craftingSlots[] = new SlotFake[9];
|
||||
SlotFake outputSlots[] = new SlotFake[3];
|
||||
SlotPatternTerm craftSlot;
|
||||
SlotRestrictedInput patternSlot;
|
||||
|
||||
PartPatternTerminal ct;
|
||||
|
||||
|
@ -26,16 +29,18 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
|||
super( ip, montiorable, false );
|
||||
ct = (PartPatternTerminal) montiorable;
|
||||
|
||||
IInventory patternInv = ct.getInventoryByName( "pattern" );
|
||||
IInventory crafting = ct.getInventoryByName( "crafting" );
|
||||
|
||||
for (int y = 0; y < 3; y++)
|
||||
for (int x = 0; x < 3; x++)
|
||||
addSlotToContainer( craftingSlots[x + y * 3] = new SlotFake( crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) );
|
||||
addSlotToContainer( craftingSlots[x + y * 3] = new SlotFake( crafting, x + y * 3, 54 + x * 18, -72 + y * 18 ) );
|
||||
|
||||
for (int y = 0; y < 3; y++)
|
||||
addSlotToContainer( outputSlots[y] = new SlotFake( crafting, y * 3, 37, -72 + y * 18 ) );
|
||||
addSlotToContainer( outputSlots[y] = new SlotFake( crafting, y * 3, 146, -72 + y * 18 ) );
|
||||
|
||||
addSlotToContainer( craftSlot = new SlotPatternTerm( craftSlotInv, 0, 37, -72 ) );
|
||||
addSlotToContainer( patternSlot = new SlotRestrictedInput( PlaceableItemType.PATTERN, patternInv, 0, 17, -72 - 5 ) );
|
||||
addSlotToContainer( craftSlot = new SlotPatternTerm( craftSlotInv, 0, 17, -72 + 38 ) );
|
||||
|
||||
bindPlayerInventory( ip, 0, 0 );
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
|||
|
||||
ENCODEABLE_ITEM(4 * 16 + 15), TRASH(5 * 16 + 15), VALID_ENCODED_PATTERN_W_OUPUT(7 * 16 + 15), ENCODED_PATTERN_W_OUTPUT(7 * 16 + 15),
|
||||
|
||||
ENCODED_PATTERN(7 * 16 + 15), BLANK_PATTERN(8 * 16 + 15), POWERED_TOOL(9 * 16 + 15),
|
||||
ENCODED_PATTERN(7 * 16 + 15), PATTERN(8 * 16 + 15), BLANK_PATTERN(8 * 16 + 15), POWERED_TOOL(9 * 16 + 15),
|
||||
|
||||
RANGE_BOOSTER(6 * 16 + 15), QE_SINGULARTIY(10 * 16 + 15), SPATIAL_STORAGE_CELLS(11 * 16 + 15),
|
||||
|
||||
|
@ -131,6 +131,12 @@ public class SlotRestrictedInput extends AppEngSlot
|
|||
return pattern.isEncoded();
|
||||
return false;
|
||||
}
|
||||
case PATTERN:
|
||||
ICraftingPatternMAC p = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) i.getItem()).getPatternForItem( i ) : null;
|
||||
if ( p != null )
|
||||
return true;
|
||||
return false;
|
||||
|
||||
case BLANK_PATTERN: {
|
||||
ICraftingPatternMAC pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) i.getItem()).getPatternForItem( i ) : null;
|
||||
if ( pattern != null )
|
||||
|
@ -189,8 +195,7 @@ public class SlotRestrictedInput extends AppEngSlot
|
|||
return false;
|
||||
return true;
|
||||
case ENCODEABLE_ITEM:
|
||||
return i.getItem() instanceof INetworkEncodable ||
|
||||
AEApi.instance().registries().wireless().isWirelessTerminal( i );
|
||||
return i.getItem() instanceof INetworkEncodable || AEApi.instance().registries().wireless().isWirelessTerminal( i );
|
||||
case BIOMETRIC_CARD:
|
||||
return i.getItem() instanceof IBiometricCard;
|
||||
case UPGRADES:
|
||||
|
|
|
@ -32,7 +32,9 @@ public enum ButtonToolTips
|
|||
|
||||
Blocking, NonBlocking, Craft, DontCraft,
|
||||
|
||||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall, TerminalStyle_Small;
|
||||
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall, TerminalStyle_Small,
|
||||
|
||||
Pull, PullDescription;
|
||||
|
||||
String root;
|
||||
|
||||
|
|
|
@ -15,11 +15,13 @@ public class PartPatternTerminal extends PartTerminal implements IAEAppEngInvent
|
|||
{
|
||||
|
||||
AppEngInternalInventory craftingGrid = new AppEngInternalInventory( this, 9 + 3 );
|
||||
AppEngInternalInventory pattern = new AppEngInternalInventory( this, 1 );
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound data)
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
pattern.writeToNBT( data, "pattern" );
|
||||
craftingGrid.writeToNBT( data, "craftingGrid" );
|
||||
}
|
||||
|
||||
|
@ -27,6 +29,7 @@ public class PartPatternTerminal extends PartTerminal implements IAEAppEngInvent
|
|||
public void readFromNBT(NBTTagCompound data)
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
pattern.readFromNBT( data, "pattern" );
|
||||
craftingGrid.readFromNBT( data, "craftingGrid" );
|
||||
}
|
||||
|
||||
|
@ -36,6 +39,10 @@ public class PartPatternTerminal extends PartTerminal implements IAEAppEngInvent
|
|||
for (ItemStack is : craftingGrid)
|
||||
if ( is != null )
|
||||
drops.add( is );
|
||||
|
||||
for (ItemStack is : pattern)
|
||||
if ( is != null )
|
||||
drops.add( is );
|
||||
}
|
||||
|
||||
public PartPatternTerminal(ItemStack is) {
|
||||
|
@ -56,6 +63,8 @@ public class PartPatternTerminal extends PartTerminal implements IAEAppEngInvent
|
|||
{
|
||||
if ( name.equals( "crafting" ) )
|
||||
return craftingGrid;
|
||||
if ( name.equals( "pattern" ) )
|
||||
return pattern;
|
||||
return super.getInventoryByName( name );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue