From dd1ae4a9b5105e135e608060c3ef42547eb9ae76 Mon Sep 17 00:00:00 2001 From: yueh Date: Sat, 26 Dec 2015 22:02:20 +0100 Subject: [PATCH] Interfaces now slow down with failed crafting attempts. Cleanup of unneeded tracking of failed attempts of MultiCraftingTracker. Followup of #1905 --- .../appeng/helpers/MultiCraftingTracker.java | 15 ++----------- .../parts/automation/PartExportBus.java | 21 ------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/src/main/java/appeng/helpers/MultiCraftingTracker.java b/src/main/java/appeng/helpers/MultiCraftingTracker.java index 4a49e588..2c57478e 100644 --- a/src/main/java/appeng/helpers/MultiCraftingTracker.java +++ b/src/main/java/appeng/helpers/MultiCraftingTracker.java @@ -46,7 +46,6 @@ public class MultiCraftingTracker private Future[] jobs = null; private ICraftingLink[] links = null; - private int failedCraftingAttempts = 0; public MultiCraftingTracker( final ICraftingRequester o, final int size ) { @@ -54,11 +53,6 @@ public class MultiCraftingTracker this.size = size; } - public int getFailedCraftingAttempts() - { - return this.failedCraftingAttempts; - } - public void readFromNBT( final NBTTagCompound extra ) { for( int x = 0; x < this.size; x++ ) @@ -115,15 +109,10 @@ public class MultiCraftingTracker if( link != null ) { - this.failedCraftingAttempts = Math.max( 0, this.failedCraftingAttempts - 1 ); - this.setLink( x, link ); + + return true; } - else - { - this.failedCraftingAttempts = Math.min( 10, this.failedCraftingAttempts + 1 ); - } - return true; } } catch( final InterruptedException e ) diff --git a/src/main/java/appeng/parts/automation/PartExportBus.java b/src/main/java/appeng/parts/automation/PartExportBus.java index fcebc209..31d51391 100644 --- a/src/main/java/appeng/parts/automation/PartExportBus.java +++ b/src/main/java/appeng/parts/automation/PartExportBus.java @@ -176,13 +176,6 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest // :P } - final int failedAttempts = this.craftingTracker.getFailedCraftingAttempts(); - - if( this.isCraftingEnabled() && failedAttempts > 0 ) - { - return this.getFailedCraftingPenalty( failedAttempts ); - } - return this.didSomething ? TickRateModulation.FASTER : TickRateModulation.SLOWER; } @@ -388,18 +381,4 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest this.nextSlot = ( this.nextSlot + x ) % this.availableSlots(); } } - - private TickRateModulation getFailedCraftingPenalty( final int failedAttempts ) - { - if( failedAttempts > 5 ) - { - return TickRateModulation.SLOWER; - } - else if( failedAttempts > 1 ) - { - return TickRateModulation.SAME; - } - - return TickRateModulation.FASTER; - } }