Improved MEInventoryHandler.getAccess()

Changed the public fields to setters and getters
Added a cache for the evaluated values instead of calculating with each
access
This commit is contained in:
yueh
2015-03-15 15:03:45 +01:00
parent 95fb894ba3
commit 1bb0109c45
7 changed files with 95 additions and 43 deletions
@@ -313,9 +313,10 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
private void updateHandler()
{
this.myHandler.myAccess = AccessRestriction.WRITE;
this.myHandler.myWhitelist = this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST;
this.myHandler.myPriority = this.priority;
this.myHandler.setBaseAccess( AccessRestriction.WRITE );
;
this.myHandler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.myHandler.setPriority( this.priority );
IItemList<IAEItemStack> priorityList = AEApi.instance().storage().createItemList();
@@ -328,9 +329,9 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
}
if ( this.getInstalledUpgrades( Upgrades.FUZZY ) > 0 )
this.myHandler.myPartitionList = new FuzzyPriorityList( priorityList, ( FuzzyMode ) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) );
this.myHandler.setPartitionList( new FuzzyPriorityList( priorityList, ( FuzzyMode ) this.getConfigManager().getSetting( Settings.FUZZY_MODE ) ) );
else
this.myHandler.myPartitionList = new PrecisePriorityList( priorityList );
this.myHandler.setPartitionList( new PrecisePriorityList( priorityList ) );
try
{