Added an option to toggle oredict subsitutions for patterns.
It adds a backward compatibility to convert current patterns to use oredict by default, which should be removed with rv4 stable. Closes #1156
This commit is contained in:
@@ -46,6 +46,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
private final AppEngInternalInventory pattern = new AppEngInternalInventory( this, 2 );
|
||||
|
||||
private boolean craftingMode = true;
|
||||
private boolean substitute = false;
|
||||
|
||||
@Reflected
|
||||
public PartPatternTerminal( final ItemStack is )
|
||||
@@ -70,6 +71,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
this.setCraftingRecipe( data.getBoolean( "craftingMode" ) );
|
||||
this.setSubstitution( data.getBoolean( "substitute" ) );
|
||||
this.pattern.readFromNBT( data, "pattern" );
|
||||
this.output.readFromNBT( data, "outputList" );
|
||||
this.crafting.readFromNBT( data, "craftingGrid" );
|
||||
@@ -80,6 +82,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
data.setBoolean( "craftingMode", this.craftingMode );
|
||||
data.setBoolean( "substitute", this.substitute );
|
||||
this.pattern.writeToNBT( data, "pattern" );
|
||||
this.output.writeToNBT( data, "outputList" );
|
||||
this.crafting.writeToNBT( data, "craftingGrid" );
|
||||
@@ -118,6 +121,7 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
if( details != null )
|
||||
{
|
||||
this.setCraftingRecipe( details.isCraftable() );
|
||||
this.setSubstitution( details.canSubstitute() );
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++ )
|
||||
{
|
||||
@@ -167,6 +171,16 @@ public class PartPatternTerminal extends AbstractPartTerminal
|
||||
this.fixCraftingRecipes();
|
||||
}
|
||||
|
||||
public boolean isSubstitution()
|
||||
{
|
||||
return this.substitute;
|
||||
}
|
||||
|
||||
public void setSubstitution( boolean canSubstitute )
|
||||
{
|
||||
this.substitute = canSubstitute;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IInventory getInventoryByName( final String name )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user