tiny progress...

This commit is contained in:
AlgorithmX2
2014-04-08 21:56:59 -05:00
parent 0cec53eece
commit 7dc251611c
6 changed files with 39 additions and 35 deletions
@@ -12,16 +12,16 @@ import appeng.core.localization.GuiText;
public class GuiPatternTerm extends GuiMEMonitorable
{
GuiImgButton clearBtn;
GuiImgButton exttractPatternBtn;
GuiImgButton substitutionsBtn;
@Override
public void initGui()
{
super.initGui();
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;
buttonList.add( exttractPatternBtn = new GuiImgButton( this.guiLeft + 6, this.guiTop + this.ySize - 161, Settings.ACTIONS, ActionItems.PULL ) );
buttonList.add( substitutionsBtn = new GuiImgButton( this.guiLeft + 118, this.guiTop + this.ySize - 161, Settings.ACTIONS, ActionItems.CLOSE ) );
exttractPatternBtn.halfSize = true;
}
@Override
@@ -29,7 +29,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
{
super.actionPerformed( btn );
if ( clearBtn == btn )
if ( exttractPatternBtn == btn )
{
}
@@ -42,7 +42,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
public GuiPatternTerm(InventoryPlayer inventoryPlayer, ITerminalHost te) {
super( inventoryPlayer, te, new ContainerPatternTerm( inventoryPlayer, te ) );
reservedSpace = 73;
reservedSpace = 85;
}
protected String getBackground()
@@ -54,7 +54,7 @@ public class GuiPatternTerm extends GuiMEMonitorable
public void drawFG(int offsetX, int offsetY, int mouseX, int mouseY)
{
super.drawFG( offsetX, offsetY, mouseX, mouseY );
fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, ySize - 96 + 1 - reservedSpace, 4210752 );
fontRendererObj.drawString( GuiText.PatternTerminal.getLocal(), 8, ySize - 96 + 2 - reservedSpace, 4210752 );
}
}
@@ -34,14 +34,15 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
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, 54 + x * 18, -72 + y * 18 ) );
addSlotToContainer( craftingSlots[x + y * 3] = new SlotFake( crafting, x + y * 3, 54 + x * 18, -76 + y * 18 ) );
for (int y = 0; y < 3; y++)
addSlotToContainer( outputSlots[y] = new SlotFake( crafting, y * 3, 146, -72 + y * 18 ) );
addSlotToContainer( outputSlots[y] = new SlotFake( crafting, 9 + y, 146, -76 + y * 18 ) );
addSlotToContainer( patternSlot = new SlotRestrictedInput( PlaceableItemType.PATTERN, patternInv, 0, 17, -72 - 5 ) );
addSlotToContainer( craftSlot = new SlotPatternTerm( craftSlotInv, 0, 17, -72 + 38 ) );
addSlotToContainer( patternSlot = new SlotRestrictedInput( PlaceableItemType.PATTERN, patternInv, 0, 17, -72 - 9 ) );
addSlotToContainer( craftSlot = new SlotPatternTerm( craftSlotInv, 0, 17, -72 + 34 ) );
patternSlot.setStackLimit( 1 );
bindPlayerInventory( ip, 0, 0 );
}
+16 -21
View File
@@ -10,7 +10,7 @@ import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import appeng.api.AEApi;
import appeng.api.IAppEngApi;
import appeng.api.crafting.ICraftingPatternMAC;
import appeng.api.crafting.ICraftingPatternDetails;
import appeng.api.features.INetworkEncodable;
import appeng.api.implementations.ICraftingPatternItem;
import appeng.api.implementations.items.IBiometricCard;
@@ -18,6 +18,7 @@ import appeng.api.implementations.items.ISpatialStorageCell;
import appeng.api.implementations.items.IStorageComponent;
import appeng.api.implementations.items.IUpgradeModule;
import appeng.api.storage.ICellWorkbenchItem;
import appeng.api.storage.data.IAEItemStack;
import appeng.recipes.handlers.Inscribe;
import appeng.util.Platform;
@@ -57,8 +58,8 @@ public class SlotRestrictedInput extends AppEngSlot
{
if ( which == PlaceableItemType.VALID_ENCODED_PATTERN_W_OUPUT )
{
ICraftingPatternMAC ap = is.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) is.getItem()).getPatternForItem( is ) : null;
if ( ap != null && ap.isEncoded() && ap.isCraftable( theWorld ) )
ICraftingPatternDetails ap = is.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) is.getItem()).getPatternForItem( is ) : null;
if ( ap != null )
return true;
return false;
}
@@ -93,12 +94,15 @@ public class SlotRestrictedInput extends AppEngSlot
if ( Platform.isClient() && (which == PlaceableItemType.VALID_ENCODED_PATTERN_W_OUPUT || which == PlaceableItemType.ENCODED_PATTERN_W_OUTPUT) )
{
ItemStack is = super.getStack();
if ( is != null )
if ( is != null && is.getItem() instanceof ICraftingPatternItem )
{
ICraftingPatternMAC ap = is.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) is.getItem()).getPatternForItem( is ) : null;
if ( ap != null )
ICraftingPatternItem it = (ICraftingPatternItem) is.getItem();
ICraftingPatternDetails details = it.getPatternForItem( is );
if ( details != null )
{
return ap.getOutput().getItemStack();
IAEItemStack list[] = details.getOutputs();
if ( list.length > 0 )
return list[0].getItemStack();
}
}
}
@@ -126,24 +130,15 @@ public class SlotRestrictedInput extends AppEngSlot
case VALID_ENCODED_PATTERN_W_OUPUT:
case ENCODED_PATTERN_W_OUTPUT:
case ENCODED_PATTERN: {
ICraftingPatternMAC pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) i.getItem()).getPatternForItem( i ) : null;
if ( pattern != null )
return pattern.isEncoded();
return false;
ICraftingPatternDetails pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) i.getItem()).getPatternForItem( i ) : null;
return pattern != null;
}
case PATTERN:
ICraftingPatternMAC p = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) i.getItem()).getPatternForItem( i ) : null;
if ( p != null )
if ( i.getItem() instanceof ICraftingPatternItem )
return true;
return false;
case BLANK_PATTERN: {
ICraftingPatternMAC pattern = i.getItem() instanceof ICraftingPatternItem ? ((ICraftingPatternItem) i.getItem()).getPatternForItem( i ) : null;
if ( pattern != null )
return !pattern.isEncoded();
return false;
}
return AEApi.instance().materials().materialBlankPattern.sameAs( i );
case INSCRIBER_PLATE:
+1 -1
View File
@@ -34,7 +34,7 @@ public enum ButtonToolTips
LevelType, LevelType_Energy, LevelType_Item, InventoryTweaks, TerminalStyle, TerminalStyle_Full, TerminalStyle_Tall, TerminalStyle_Small,
Pull, PullDescription;
Pull, PullDescription, Substitutions, SubstitutionsOn, SubstitutionsOff;
String root;
+10 -1
View File
@@ -2,10 +2,13 @@ package appeng.items.storage;
import java.util.EnumSet;
import net.minecraft.item.ItemStack;
import appeng.api.crafting.ICraftingPatternDetails;
import appeng.api.implementations.ICraftingPatternItem;
import appeng.core.features.AEFeature;
import appeng.items.AEBaseItem;
public class ItemEncodedPattern extends AEBaseItem
public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternItem
{
public ItemEncodedPattern() {
@@ -14,4 +17,10 @@ public class ItemEncodedPattern extends AEBaseItem
setMaxStackSize( 1 );
}
@Override
public ICraftingPatternDetails getPatternForItem(ItemStack is)
{
return null;
}
}
-1
View File
@@ -15,7 +15,6 @@ import org.lwjgl.opengl.GL11;
import appeng.api.AEApi;
import appeng.api.exceptions.FailedConnection;
import appeng.api.networking.GridFlags;
import appeng.api.networking.IGridConnection;
import appeng.api.networking.IGridNode;
import appeng.api.parts.IPartCollsionHelper;