undo penalties

This commit is contained in:
Salomão
2020-10-28 16:59:51 -03:00
parent de3e0178a4
commit d6499c16b0
2 changed files with 4 additions and 32 deletions
@@ -112,8 +112,6 @@ import appeng.util.item.AEItemStack;
public class DualityInterface implements IGridTickable, IStorageMonitorable, IInventoryDestination, IAEAppEngInventory, IConfigManagerHost, ICraftingProvider, IUpgradeableHost
{
private int[] failedCraftTriesSlot = {0,0,0,0,0,0,0,0,0};
public static final int NUMBER_OF_STORAGE_SLOTS = 9;
public static final int NUMBER_OF_CONFIG_SLOTS = 9;
public static final int NUMBER_OF_PATTERN_SLOTS = 9;
@@ -761,21 +759,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
private boolean handleCrafting( final int x, final InventoryAdaptor d, final IAEItemStack itemStack )
{
try
{
if( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 && itemStack != null )
{
if (this.failedCraftTriesSlot[x] <= 0)
{
boolean crafted = this.craftingTracker.handleCrafting( x, itemStack.getStackSize(), itemStack, d, this.iHost.getTileEntity().getWorld(),
this.gridProxy.getGrid(), this.gridProxy.getCrafting(), this.mySource );
try {
if (this.getInstalledUpgrades(Upgrades.CRAFTING) > 0 && itemStack != null) {
this.craftingTracker.handleCrafting(x, itemStack.getStackSize(), itemStack, d, this.iHost.getTileEntity().getWorld(),
this.gridProxy.getGrid(), this.gridProxy.getCrafting(), this.mySource);
if (crafted) this.failedCraftTriesSlot[x] = 0;
else{
this.failedCraftTriesSlot[x] += 4;
}
}
this.failedCraftTriesSlot[x] -= 1;
}
}
catch( final GridAccessException e )
@@ -70,8 +70,6 @@ import appeng.util.item.AEItemStack;
public class PartExportBus extends PartSharedItemBus implements ICraftingRequester
{
private final int[] failedCraftTriesSlot = {0,0,0,0,0,0,0,0,0};
public static final ResourceLocation MODEL_BASE = new ResourceLocation( AppEng.MOD_ID, "part/export_bus_base" );
@PartModels
@@ -153,15 +151,8 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
if( ais == null || this.itemToSend <= 0 ) continue;
if ( this.craftOnly() ) {
if (this.failedCraftTriesSlot[x] <= 0) {
this.didSomething = this.craftingTracker.handleCrafting(slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(),
this.getProxy().getGrid(), cg, this.mySrc) || this.didSomething;
if (this.didSomething) this.failedCraftTriesSlot[x] = 0;
else this.failedCraftTriesSlot[x] += 4;
}
this.failedCraftTriesSlot[x] -= 1;
continue;
}
@@ -185,15 +176,8 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
if( this.itemToSend == before && this.isCraftingEnabled() )
{
if (this.failedCraftTriesSlot[x] <= 0) {
this.didSomething = this.craftingTracker.handleCrafting(slotToExport, this.itemToSend, ais, destination, this.getTile().getWorld(),
this.getProxy().getGrid(), cg, this.mySrc) || this.didSomething;
if (this.didSomething) this.failedCraftTriesSlot[x] = 0;
else this.failedCraftTriesSlot[x] += 4;
}
this.failedCraftTriesSlot[x] -= 1;
}
}