fix npe when placing down an ore dict storage bus

This commit is contained in:
PrototypeTrousers
2022-01-30 17:19:01 -03:00
parent f5378e060e
commit af1f5c34d2
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ aebuild=7
aegroup=appeng aegroup=appeng
aebasename=appliedenergistics2 aebasename=appliedenergistics2
extended=extended_life extended=extended_life
extendedversion=v49aa extendedversion=v49ab
######################################################### #########################################################
# Versions # # Versions #
######################################################### #########################################################
@@ -20,6 +20,7 @@ import appeng.parts.PartModel;
import appeng.util.ConfigManager; import appeng.util.ConfigManager;
import appeng.util.Platform; import appeng.util.Platform;
import appeng.util.item.OreHelper; import appeng.util.item.OreHelper;
import appeng.util.prioritylist.IPartitionList;
import appeng.util.prioritylist.OreDictPriorityList; import appeng.util.prioritylist.OreDictPriorityList;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -125,7 +126,7 @@ public class PartOreDicStorageBus extends PartStorageBus
this.handler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST ); this.handler.setWhitelist( this.getInstalledUpgrades( Upgrades.INVERTER ) > 0 ? IncludeExclude.BLACKLIST : IncludeExclude.WHITELIST );
this.handler.setPriority( this.priority ); this.handler.setPriority( this.priority );
this.handler.setPartitionList( priorityList ); this.handler.setPartitionList( this.getPriorityList() );
if( inv instanceof IBaseMonitor ) if( inv instanceof IBaseMonitor )
{ {
@@ -171,6 +172,15 @@ public class PartOreDicStorageBus extends PartStorageBus
return this.handler; return this.handler;
} }
private IPartitionList<IAEItemStack> getPriorityList()
{
if( priorityList == null )
{
this.priorityList = new OreDictPriorityList<>( OreHelper.INSTANCE.getMatchingOre( oreExp ), oreExp );
}
return priorityList;
}
public String getOreExp() public String getOreExp()
{ {
if( this.oreExp == null ) if( this.oreExp == null )