works..ish
This commit is contained in:
@@ -100,6 +100,19 @@ public class GuiPatternTerm extends GuiMEMonitorable
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Clear", "1" ) );
|
||||
}
|
||||
|
||||
if( this.x2Btn == btn )
|
||||
{
|
||||
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.MultiplyByTwo", "1" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if( this.substitutionsEnabledBtn == btn || this.substitutionsDisabledBtn == btn )
|
||||
{
|
||||
NetworkHandler.instance()
|
||||
|
||||
@@ -269,6 +269,74 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
|
||||
output.setTagCompound( encodedValue );
|
||||
}
|
||||
|
||||
public void multiply(int multiple)
|
||||
{
|
||||
ItemStack[] input = new ItemStack[9];
|
||||
ItemStack[] output = new ItemStack[3];
|
||||
|
||||
input = getInputs();
|
||||
output = getOutputs();
|
||||
boolean canMultiplyInputs = true;
|
||||
boolean canMultiplyOutputs = true;
|
||||
|
||||
for( int x = 0; x < this.craftingSlots.length; x++ )
|
||||
{
|
||||
input[x] = this.craftingSlots[x].getStack();
|
||||
if( input[x].getCount() * multiple > 64 )
|
||||
{
|
||||
canMultiplyInputs = false;
|
||||
}
|
||||
}
|
||||
|
||||
if( this.isCraftingMode() )
|
||||
{
|
||||
output[0] = this.outputSlots[0].getStack();
|
||||
if( output[0].getCount() * multiple > 64 )
|
||||
{
|
||||
canMultiplyOutputs = false;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
int outSlot=0;
|
||||
for( final OptionalSlotFake outputSlot : this.outputSlots )
|
||||
{
|
||||
final ItemStack out = outputSlot.getStack();
|
||||
if( out.getCount() * multiple > 64 )
|
||||
{
|
||||
canMultiplyOutputs = false;
|
||||
}
|
||||
outSlot++;
|
||||
}
|
||||
}
|
||||
|
||||
if( canMultiplyInputs && canMultiplyOutputs )
|
||||
{
|
||||
for( int x = 0; x < this.craftingSlots.length; x++ )
|
||||
{
|
||||
ItemStack stack = this.craftingSlots[x].getStack();
|
||||
this.craftingSlots[x].getStack().setCount( stack.getCount() * multiple );
|
||||
}
|
||||
|
||||
if( this.isCraftingMode() )
|
||||
{
|
||||
ItemStack stackOut = this.craftingSlots[0].getStack();
|
||||
|
||||
this.outputSlots[0].getStack().setCount( stackOut.getCount() * multiple);
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int x = 0; x < this.outputSlots.length; x++ )
|
||||
{
|
||||
ItemStack stack = this.outputSlots[x].getStack();
|
||||
this.outputSlots[x].getStack().setCount( stack.getCount() * multiple );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private ItemStack[] getInputs()
|
||||
{
|
||||
final ItemStack[] input = new ItemStack[9];
|
||||
|
||||
@@ -181,6 +181,14 @@ public class PacketValueConfig extends AppEngPacket
|
||||
{
|
||||
cpt.clear();
|
||||
}
|
||||
else if( this.Name.equals( "PatternTerminal.MultiplyByTwo" ) )
|
||||
{
|
||||
cpt.multiply(2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
else if( this.Name.equals( "PatternTerminal.Substitute" ) )
|
||||
{
|
||||
cpt.getPatternTerminal().setSubstitution( this.Value.equals( "1" ) );
|
||||
|
||||
Reference in New Issue
Block a user