move penalty up the chain

This commit is contained in:
Salomão
2020-10-22 01:30:59 -03:00
parent 12bf337238
commit 169f6393d1
3 changed files with 36 additions and 18 deletions
@@ -115,6 +115,7 @@ 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;
@@ -696,9 +697,9 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
throw new IllegalStateException( "bad attempt at managing inventory. ( addItems )" );
}
}
else
else
{
changed = this.handleCrafting( x, adaptor, itemStack ) || changed;
changed = this.handleCrafting(x, adaptor, itemStack) || changed;
}
}
else if( itemStack.getStackSize() < 0 )
@@ -766,8 +767,16 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
{
if( this.getInstalledUpgrades( Upgrades.CRAFTING ) > 0 && itemStack != null )
{
return this.craftingTracker.handleCrafting( x, itemStack.getStackSize(), itemStack, d, this.iHost.getTileEntity().getWorld(),
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 );
if (crafted) this.failedCraftTriesSlot[x] = 0;
else this.failedCraftTriesSlot[x] += 20;
}
this.failedCraftTriesSlot[x] -= 1;
}
}
catch( final GridAccessException e )