Storage Bus can now optionally show inaccessible items.
This commit is contained in:
parent
2d12ffc304
commit
bcdc47622c
4 changed files with 31 additions and 3 deletions
|
@ -11,6 +11,7 @@ import appeng.api.config.AccessRestriction;
|
||||||
import appeng.api.config.ActionItems;
|
import appeng.api.config.ActionItems;
|
||||||
import appeng.api.config.FuzzyMode;
|
import appeng.api.config.FuzzyMode;
|
||||||
import appeng.api.config.Settings;
|
import appeng.api.config.Settings;
|
||||||
|
import appeng.api.config.StorageFilter;
|
||||||
import appeng.client.gui.widgets.GuiImgButton;
|
import appeng.client.gui.widgets.GuiImgButton;
|
||||||
import appeng.client.gui.widgets.GuiTabButton;
|
import appeng.client.gui.widgets.GuiTabButton;
|
||||||
import appeng.container.implementations.ContainerStorageBus;
|
import appeng.container.implementations.ContainerStorageBus;
|
||||||
|
@ -27,6 +28,7 @@ public class GuiStorageBus extends GuiUpgradeable
|
||||||
{
|
{
|
||||||
|
|
||||||
GuiImgButton rwMode;
|
GuiImgButton rwMode;
|
||||||
|
GuiImgButton storageFilter;
|
||||||
GuiTabButton priority;
|
GuiTabButton priority;
|
||||||
GuiImgButton partition;
|
GuiImgButton partition;
|
||||||
GuiImgButton clear;
|
GuiImgButton clear;
|
||||||
|
@ -51,6 +53,9 @@ public class GuiStorageBus extends GuiUpgradeable
|
||||||
if ( fuzzyMode != null )
|
if ( fuzzyMode != null )
|
||||||
fuzzyMode.set( cvb.fzMode );
|
fuzzyMode.set( cvb.fzMode );
|
||||||
|
|
||||||
|
if ( storageFilter != null )
|
||||||
|
storageFilter.set( ((ContainerStorageBus) cvb).storageFilter );
|
||||||
|
|
||||||
if ( rwMode != null )
|
if ( rwMode != null )
|
||||||
rwMode.set( ((ContainerStorageBus) cvb).rwMode );
|
rwMode.set( ((ContainerStorageBus) cvb).rwMode );
|
||||||
}
|
}
|
||||||
|
@ -61,10 +66,12 @@ public class GuiStorageBus extends GuiUpgradeable
|
||||||
clear = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE );
|
clear = new GuiImgButton( this.guiLeft - 18, guiTop + 8, Settings.ACTIONS, ActionItems.CLOSE );
|
||||||
partition = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH );
|
partition = new GuiImgButton( this.guiLeft - 18, guiTop + 28, Settings.ACTIONS, ActionItems.WRENCH );
|
||||||
rwMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE );
|
rwMode = new GuiImgButton( this.guiLeft - 18, guiTop + 48, Settings.ACCESS, AccessRestriction.READ_WRITE );
|
||||||
fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 68, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
storageFilter = new GuiImgButton( this.guiLeft - 18, guiTop + 68, Settings.STORAGE_FILTER, StorageFilter.EXTACTABLE_ONLY );
|
||||||
|
fuzzyMode = new GuiImgButton( this.guiLeft - 18, guiTop + 88, Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||||
|
|
||||||
buttonList.add( priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) );
|
buttonList.add( priority = new GuiTabButton( this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(), itemRender ) );
|
||||||
|
|
||||||
|
buttonList.add( storageFilter );
|
||||||
buttonList.add( fuzzyMode );
|
buttonList.add( fuzzyMode );
|
||||||
buttonList.add( rwMode );
|
buttonList.add( rwMode );
|
||||||
buttonList.add( partition );
|
buttonList.add( partition );
|
||||||
|
@ -94,6 +101,10 @@ public class GuiStorageBus extends GuiUpgradeable
|
||||||
|
|
||||||
else if ( btn == rwMode )
|
else if ( btn == rwMode )
|
||||||
NetworkHandler.instance.sendToServer( new PacketConfigButton( rwMode.getSetting(), backwards ) );
|
NetworkHandler.instance.sendToServer( new PacketConfigButton( rwMode.getSetting(), backwards ) );
|
||||||
|
|
||||||
|
else if ( btn == storageFilter )
|
||||||
|
NetworkHandler.instance.sendToServer( new PacketConfigButton( storageFilter.getSetting(), backwards ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,7 @@ import appeng.api.config.SearchBoxMode;
|
||||||
import appeng.api.config.Settings;
|
import appeng.api.config.Settings;
|
||||||
import appeng.api.config.SortDir;
|
import appeng.api.config.SortDir;
|
||||||
import appeng.api.config.SortOrder;
|
import appeng.api.config.SortOrder;
|
||||||
|
import appeng.api.config.StorageFilter;
|
||||||
import appeng.api.config.TerminalStyle;
|
import appeng.api.config.TerminalStyle;
|
||||||
import appeng.api.config.ViewItems;
|
import appeng.api.config.ViewItems;
|
||||||
import appeng.api.config.YesNo;
|
import appeng.api.config.YesNo;
|
||||||
|
@ -176,6 +177,14 @@ public class GuiImgButton extends GuiButton implements ITooltip
|
||||||
|
|
||||||
registerApp( 16 * 1 + 3, Settings.CRAFT_ONLY, YesNo.YES, ButtonToolTips.Craft, ButtonToolTips.CraftOnly );
|
registerApp( 16 * 1 + 3, Settings.CRAFT_ONLY, YesNo.YES, ButtonToolTips.Craft, ButtonToolTips.CraftOnly );
|
||||||
registerApp( 16 * 1 + 2, Settings.CRAFT_ONLY, YesNo.NO, ButtonToolTips.Craft, ButtonToolTips.CraftEither );
|
registerApp( 16 * 1 + 2, Settings.CRAFT_ONLY, YesNo.NO, ButtonToolTips.Craft, ButtonToolTips.CraftEither );
|
||||||
|
|
||||||
|
registerApp( 16 * 11 + 2, Settings.CRAFT_VIA_REDSTONE, YesNo.YES, ButtonToolTips.EmitterMode, ButtonToolTips.CraftViaRedstone );
|
||||||
|
registerApp( 16 * 11 + 1, Settings.CRAFT_VIA_REDSTONE, YesNo.NO, ButtonToolTips.EmitterMode, ButtonToolTips.EmitWhenCrafing );
|
||||||
|
|
||||||
|
registerApp( 16 * 3 + 5, Settings.STORAGE_FILTER, StorageFilter.EXTACTABLE_ONLY, ButtonToolTips.ReportInaccessibleItems,
|
||||||
|
ButtonToolTips.ReportInaccessibleItemsNo );
|
||||||
|
registerApp( 16 * 3 + 6, Settings.STORAGE_FILTER, StorageFilter.NONE, ButtonToolTips.ReportInaccessibleItems,
|
||||||
|
ButtonToolTips.ReportInaccessibleItemsYes );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import appeng.api.AEApi;
|
import appeng.api.AEApi;
|
||||||
import appeng.api.config.AccessRestriction;
|
import appeng.api.config.AccessRestriction;
|
||||||
import appeng.api.config.Actionable;
|
import appeng.api.config.Actionable;
|
||||||
|
import appeng.api.config.StorageFilter;
|
||||||
import appeng.api.networking.security.BaseActionSource;
|
import appeng.api.networking.security.BaseActionSource;
|
||||||
import appeng.api.networking.ticking.TickRateModulation;
|
import appeng.api.networking.ticking.TickRateModulation;
|
||||||
import appeng.api.storage.IMEInventory;
|
import appeng.api.storage.IMEInventory;
|
||||||
|
@ -51,6 +52,7 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
|
||||||
final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap();
|
final HashMap<IMEMonitorHandlerReceiver<IAEItemStack>, Object> listeners = new HashMap();
|
||||||
|
|
||||||
public BaseActionSource mySource;
|
public BaseActionSource mySource;
|
||||||
|
public StorageFilter mode = StorageFilter.EXTACTABLE_ONLY;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addListener(IMEMonitorHandlerReceiver<IAEItemStack> l, Object verificationToken)
|
public void addListener(IMEMonitorHandlerReceiver<IAEItemStack> l, Object verificationToken)
|
||||||
|
@ -165,7 +167,7 @@ public class MEMonitorIInventory implements IMEInventory<IAEItemStack>, IMEMonit
|
||||||
for (ItemSlot is : adaptor)
|
for (ItemSlot is : adaptor)
|
||||||
{
|
{
|
||||||
CachedItemStack old = memory.get( is.slot );
|
CachedItemStack old = memory.get( is.slot );
|
||||||
ItemStack newIS = is == null || is.isExtractable == false ? null : is.getItemStack();
|
ItemStack newIS = is == null || is.isExtractable == false && mode == StorageFilter.EXTACTABLE_ONLY ? null : is.getItemStack();
|
||||||
ItemStack oldIS = old == null ? null : old.itemStack;
|
ItemStack oldIS = old == null ? null : old.itemStack;
|
||||||
|
|
||||||
if ( isDiffrent( newIS, oldIS ) )
|
if ( isDiffrent( newIS, oldIS ) )
|
||||||
|
|
|
@ -16,6 +16,7 @@ import appeng.api.config.AccessRestriction;
|
||||||
import appeng.api.config.FuzzyMode;
|
import appeng.api.config.FuzzyMode;
|
||||||
import appeng.api.config.IncludeExclude;
|
import appeng.api.config.IncludeExclude;
|
||||||
import appeng.api.config.Settings;
|
import appeng.api.config.Settings;
|
||||||
|
import appeng.api.config.StorageFilter;
|
||||||
import appeng.api.config.Upgrades;
|
import appeng.api.config.Upgrades;
|
||||||
import appeng.api.networking.IGridNode;
|
import appeng.api.networking.IGridNode;
|
||||||
import appeng.api.networking.events.MENetworkCellArrayUpdate;
|
import appeng.api.networking.events.MENetworkCellArrayUpdate;
|
||||||
|
@ -75,6 +76,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||||
super( PartStorageBus.class, is );
|
super( PartStorageBus.class, is );
|
||||||
getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE );
|
getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE );
|
||||||
getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL );
|
||||||
|
getConfigManager().registerSetting( Settings.STORAGE_FILTER, StorageFilter.EXTACTABLE_ONLY );
|
||||||
mySrc = new MachineSource( this );
|
mySrc = new MachineSource( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,7 +274,11 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
|
||||||
IMEInventory inv = esh.getInventory( target, side.getOpposite(), StorageChannel.ITEMS, mySrc );
|
IMEInventory inv = esh.getInventory( target, side.getOpposite(), StorageChannel.ITEMS, mySrc );
|
||||||
|
|
||||||
if ( inv instanceof MEMonitorIInventory )
|
if ( inv instanceof MEMonitorIInventory )
|
||||||
((MEMonitorIInventory) inv).mySource = new MachineSource( this );
|
{
|
||||||
|
MEMonitorIInventory h = (MEMonitorIInventory) inv;
|
||||||
|
h.mode = (StorageFilter) getConfigManager().getSetting( Settings.STORAGE_FILTER );
|
||||||
|
h.mySource = new MachineSource( this );
|
||||||
|
}
|
||||||
|
|
||||||
if ( inv instanceof MEMonitorIInventory )
|
if ( inv instanceof MEMonitorIInventory )
|
||||||
monitor = (MEMonitorIInventory) inv;
|
monitor = (MEMonitorIInventory) inv;
|
||||||
|
|
Loading…
Reference in a new issue