encoded patterns now stack up to 64

This commit is contained in:
Salomão
2021-02-08 22:14:37 -03:00
parent fc119070b2
commit 97ae7e1f14
7 changed files with 32 additions and 7 deletions
@@ -92,7 +92,13 @@ public class GuiPatternTerm extends GuiMEMonitorable
if( this.encodeBtn == btn )
{
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
if ( isShiftKeyDown() ){
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "2" ) );
}
else
{
NetworkHandler.instance().sendToServer( new PacketValueConfig( "PatternTerminal.Encode", "1" ) );
}
}
if( this.clearBtn == btn )
@@ -53,7 +53,7 @@ public class ContainerInterface extends ContainerUpgradeable
for( int x = 0; x < DualityInterface.NUMBER_OF_PATTERN_SLOTS; x++ )
{
this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality
.getPatterns(), x, 8 + 18 * x, 90 + 7, this.getInventoryPlayer() ) );
.getPatterns(), x, 8 + 18 * x, 90 + 7, this.getInventoryPlayer() ).setStackLimit( 1 ) );
}
for( int x = 0; x < DualityInterface.NUMBER_OF_CONFIG_SLOTS; x++ )
@@ -203,6 +203,19 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
}
public void encodeAndMoveToInventory()
{
encode();
ItemStack output = this.patternSlotOUT.getStack();
if ( !output.isEmpty() )
{
if (!getPlayerInv().addItemStackToInventory( output )){
getPlayerInv().player.dropItem( output , false );
}
this.patternSlotOUT.putStack( ItemStack.EMPTY );
}
}
public void encode()
{
ItemStack output = this.patternSlotOUT.getStack();
@@ -175,7 +175,13 @@ public class PacketValueConfig extends AppEngPacket
}
else if( this.Name.equals( "PatternTerminal.Encode" ) )
{
cpt.encode();
if (this.Value.equals( "2" )) {
cpt.encodeAndMoveToInventory();
}
else
{
cpt.encode();
}
}
else if( this.Name.equals( "PatternTerminal.Clear" ) )
{
@@ -56,7 +56,7 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
public ItemEncodedPattern()
{
this.setMaxStackSize( 1 );
this.setMaxStackSize( 64 );
}
@Override