mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-17 10:55:06 +00:00
fix pattern remove and add
This commit is contained in:
1 parent
0bc3e5b9a5
commit
89837f9497
5 files changed
+62
-4
No files matched your search
@@ -21,6 +21,7 @@ import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.inv.AdaptorPlayerHand;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminal;
|
||||
import com.glodblock.github.util.Util;
|
||||
@@ -208,6 +209,12 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack( output );
|
||||
}
|
||||
} else if ( output.getItem() instanceof ItemFluidEncodedPattern ) {
|
||||
for( final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack( output );
|
||||
}
|
||||
}
|
||||
|
||||
// encode the slot.
|
||||
@@ -298,7 +305,9 @@ public class FCBasePartContainer extends FCBaseMonitorContain implements IAEAppE
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (output.getItem() instanceof ItemFluidEncodedPattern) {
|
||||
return true;
|
||||
}
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
|
||||
boolean isPattern = definitions.items().encodedPattern().isSameAs( output );
|
||||
|
||||
@@ -10,6 +10,7 @@ import appeng.tile.inventory.AppEngInternalInventory;
|
||||
import appeng.tile.inventory.IAEAppEngInventory;
|
||||
import appeng.tile.inventory.InvOperation;
|
||||
import appeng.util.Platform;
|
||||
import com.glodblock.github.common.item.ItemFluidEncodedPattern;
|
||||
import com.glodblock.github.common.item.ItemFluidPacket;
|
||||
import com.glodblock.github.common.parts.PartFluidPatternTerminalEx;
|
||||
import com.glodblock.github.util.Util;
|
||||
@@ -151,6 +152,12 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack( output );
|
||||
}
|
||||
} else if ( output.getItem() instanceof ItemFluidEncodedPattern ) {
|
||||
for( final ItemStack encodedPatternStack : AEApi.instance().definitions().items().encodedPattern().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
output = encodedPatternStack;
|
||||
this.patternSlotOUT.putStack( output );
|
||||
}
|
||||
}
|
||||
|
||||
// encode the slot.
|
||||
@@ -228,7 +235,9 @@ public class FCBasePartContainerEx extends FCBaseMonitorContain implements IAEAp
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (output.getItem() instanceof ItemFluidEncodedPattern) {
|
||||
return true;
|
||||
}
|
||||
final IDefinitions definitions = AEApi.instance().definitions();
|
||||
|
||||
boolean isPattern = definitions.items().encodedPattern().isSameAs( output );
|
||||
|
||||
@@ -131,6 +131,16 @@ public class PartFluidPatternTerminal extends FCBasePart {
|
||||
this.setCraftingRecipe( details.isCraftable() );
|
||||
this.setSubstitution( details.canSubstitute() );
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory(); x++ )
|
||||
{
|
||||
this.crafting.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.output.getSizeInventory(); x++ )
|
||||
{
|
||||
this.output.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++ )
|
||||
{
|
||||
final IAEItemStack item = details.getInputs()[x];
|
||||
@@ -166,6 +176,16 @@ public class PartFluidPatternTerminal extends FCBasePart {
|
||||
this.setCraftingRecipe( details.isCraftable() );
|
||||
this.setSubstitution( details.canSubstitute() );
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory(); x++ )
|
||||
{
|
||||
this.crafting.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.output.getSizeInventory(); x++ )
|
||||
{
|
||||
this.output.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++ )
|
||||
{
|
||||
final IAEItemStack item = details.getInputs()[x];
|
||||
|
||||
@@ -127,6 +127,16 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
{
|
||||
this.setSubstitution( details.canSubstitute() );
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory(); x++ )
|
||||
{
|
||||
this.crafting.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.output.getSizeInventory(); x++ )
|
||||
{
|
||||
this.output.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++ )
|
||||
{
|
||||
final IAEItemStack item = details.getInputs()[x];
|
||||
@@ -157,6 +167,16 @@ public class PartFluidPatternTerminalEx extends FCBasePart {
|
||||
{
|
||||
this.setSubstitution( details.canSubstitute() );
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory(); x++ )
|
||||
{
|
||||
this.crafting.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.output.getSizeInventory(); x++ )
|
||||
{
|
||||
this.output.setInventorySlotContents( x, null );
|
||||
}
|
||||
|
||||
for( int x = 0; x < this.crafting.getSizeInventory() && x < details.getInputs().length; x++ )
|
||||
{
|
||||
final IAEItemStack item = details.getInputs()[x];
|
||||
|
||||
@@ -186,8 +186,8 @@ public class FluidPatternDetails implements ICraftingPatternDetails, Comparable<
|
||||
NBTTagCompound tag = Objects.requireNonNull(patternStack.getTagCompound());
|
||||
// may be possible to enter a partially-correct state if setInputs succeeds but setOutputs failed
|
||||
// but outside code should treat it as completely incorrect and not attempt to make calls
|
||||
return setInputs(readStackArray(tag.getTagList("Inputs", Constants.NBT.TAG_COMPOUND), 9))
|
||||
&& setOutputs(readStackArray(tag.getTagList("Outputs", Constants.NBT.TAG_COMPOUND), 3));
|
||||
return setInputs(readStackArray(tag.getTagList("in", Constants.NBT.TAG_COMPOUND), 9))
|
||||
&& setOutputs(readStackArray(tag.getTagList("out", Constants.NBT.TAG_COMPOUND), 3));
|
||||
}
|
||||
|
||||
public static IAEItemStack[] readStackArray(NBTTagList listTag, int maxCount) {
|
||||
|
||||
Reference in new issue
Block a user