Refactored StorageChannel enum into an interface (#3138)
This replaces the static enum with a more dynamic interface providing factory methods for handling network storage.
This commit is contained in:
@@ -37,6 +37,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
@@ -62,9 +63,9 @@ public class GuiCraftConfirm extends AEBaseGui
|
||||
|
||||
private final int rows = 5;
|
||||
|
||||
private final IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||
private final IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
||||
private final IItemList<IAEItemStack> missing = AEApi.instance().storage().createItemList();
|
||||
private final IItemList<IAEItemStack> storage = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private final IItemList<IAEItemStack> pending = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private final IItemList<IAEItemStack> missing = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
|
||||
private final List<IAEItemStack> visual = new ArrayList<>();
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import appeng.api.AEApi;
|
||||
import appeng.api.config.SortDir;
|
||||
import appeng.api.config.SortOrder;
|
||||
import appeng.api.config.ViewItems;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.api.util.AEColor;
|
||||
@@ -84,9 +85,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
|
||||
private final ContainerCraftingCPU craftingCpu;
|
||||
|
||||
private IItemList<IAEItemStack> storage = AEApi.instance().storage().createItemList();
|
||||
private IItemList<IAEItemStack> active = AEApi.instance().storage().createItemList();
|
||||
private IItemList<IAEItemStack> pending = AEApi.instance().storage().createItemList();
|
||||
private IItemList<IAEItemStack> storage = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private IItemList<IAEItemStack> active = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
private IItemList<IAEItemStack> pending = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
|
||||
private List<IAEItemStack> visual = new ArrayList<>();
|
||||
private GuiButton cancel;
|
||||
@@ -110,9 +111,9 @@ public class GuiCraftingCPU extends AEBaseGui implements ISortSource
|
||||
|
||||
public void clearItems()
|
||||
{
|
||||
this.storage = AEApi.instance().storage().createItemList();
|
||||
this.active = AEApi.instance().storage().createItemList();
|
||||
this.pending = AEApi.instance().storage().createItemList();
|
||||
this.storage = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.active = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.pending = AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createList();
|
||||
this.visual = new ArrayList<>();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.channels.IItemStorageChannel;
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.widgets.GuiScrollbar;
|
||||
import appeng.client.gui.widgets.MEGuiTextField;
|
||||
@@ -347,7 +348,9 @@ public class GuiInterfaceTerminal extends AEBaseGui
|
||||
final ItemStack parsedItemStack = new ItemStack( outTag.getCompoundTagAt( i ) );
|
||||
if( !parsedItemStack.isEmpty() )
|
||||
{
|
||||
final String displayName = Platform.getItemDisplayName( AEApi.instance().storage().createItemStack( parsedItemStack ) ).toLowerCase();
|
||||
final String displayName = Platform
|
||||
.getItemDisplayName( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( parsedItemStack ) )
|
||||
.toLowerCase();
|
||||
if( displayName.contains( searchTerm ) )
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user