diff --git a/client/gui/implementations/GuiStorageBus.java b/client/gui/implementations/GuiStorageBus.java index 096f9f73..28e9a4a9 100644 --- a/client/gui/implementations/GuiStorageBus.java +++ b/client/gui/implementations/GuiStorageBus.java @@ -11,6 +11,7 @@ import appeng.api.config.AccessRestriction; import appeng.api.config.ActionItems; import appeng.api.config.FuzzyMode; import appeng.api.config.Settings; +import appeng.api.config.StorageFilter; import appeng.client.gui.widgets.GuiImgButton; import appeng.client.gui.widgets.GuiTabButton; import appeng.container.implementations.ContainerStorageBus; @@ -27,6 +28,7 @@ public class GuiStorageBus extends GuiUpgradeable { GuiImgButton rwMode; + GuiImgButton storageFilter; GuiTabButton priority; GuiImgButton partition; GuiImgButton clear; @@ -51,6 +53,9 @@ public class GuiStorageBus extends GuiUpgradeable if ( fuzzyMode != null ) fuzzyMode.set( cvb.fzMode ); + if ( storageFilter != null ) + storageFilter.set( ((ContainerStorageBus) cvb).storageFilter ); + if ( rwMode != null ) 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 ); 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 ); - 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( storageFilter ); buttonList.add( fuzzyMode ); buttonList.add( rwMode ); buttonList.add( partition ); @@ -94,6 +101,10 @@ public class GuiStorageBus extends GuiUpgradeable else if ( btn == rwMode ) NetworkHandler.instance.sendToServer( new PacketConfigButton( rwMode.getSetting(), backwards ) ); + + else if ( btn == storageFilter ) + NetworkHandler.instance.sendToServer( new PacketConfigButton( storageFilter.getSetting(), backwards ) ); + } catch (IOException e) { diff --git a/client/gui/widgets/GuiImgButton.java b/client/gui/widgets/GuiImgButton.java index 672e0749..2e9088ff 100644 --- a/client/gui/widgets/GuiImgButton.java +++ b/client/gui/widgets/GuiImgButton.java @@ -23,6 +23,7 @@ import appeng.api.config.SearchBoxMode; import appeng.api.config.Settings; import appeng.api.config.SortDir; import appeng.api.config.SortOrder; +import appeng.api.config.StorageFilter; import appeng.api.config.TerminalStyle; import appeng.api.config.ViewItems; 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 + 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 ); } } diff --git a/me/storage/MEMonitorIInventory.java b/me/storage/MEMonitorIInventory.java index 3ccddb0e..a7dce719 100644 --- a/me/storage/MEMonitorIInventory.java +++ b/me/storage/MEMonitorIInventory.java @@ -9,6 +9,7 @@ import net.minecraft.item.ItemStack; import appeng.api.AEApi; import appeng.api.config.AccessRestriction; import appeng.api.config.Actionable; +import appeng.api.config.StorageFilter; import appeng.api.networking.security.BaseActionSource; import appeng.api.networking.ticking.TickRateModulation; import appeng.api.storage.IMEInventory; @@ -51,6 +52,7 @@ public class MEMonitorIInventory implements IMEInventory, IMEMonit final HashMap, Object> listeners = new HashMap(); public BaseActionSource mySource; + public StorageFilter mode = StorageFilter.EXTACTABLE_ONLY; @Override public void addListener(IMEMonitorHandlerReceiver l, Object verificationToken) @@ -165,7 +167,7 @@ public class MEMonitorIInventory implements IMEInventory, IMEMonit for (ItemSlot is : adaptor) { 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; if ( isDiffrent( newIS, oldIS ) ) diff --git a/parts/misc/PartStorageBus.java b/parts/misc/PartStorageBus.java index 0f5a8a20..6e7293c2 100644 --- a/parts/misc/PartStorageBus.java +++ b/parts/misc/PartStorageBus.java @@ -16,6 +16,7 @@ import appeng.api.config.AccessRestriction; import appeng.api.config.FuzzyMode; import appeng.api.config.IncludeExclude; import appeng.api.config.Settings; +import appeng.api.config.StorageFilter; import appeng.api.config.Upgrades; import appeng.api.networking.IGridNode; import appeng.api.networking.events.MENetworkCellArrayUpdate; @@ -75,6 +76,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC super( PartStorageBus.class, is ); getConfigManager().registerSetting( Settings.ACCESS, AccessRestriction.READ_WRITE ); getConfigManager().registerSetting( Settings.FUZZY_MODE, FuzzyMode.IGNORE_ALL ); + getConfigManager().registerSetting( Settings.STORAGE_FILTER, StorageFilter.EXTACTABLE_ONLY ); 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 ); 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 ) monitor = (MEMonitorIInventory) inv;