Fixed Priority Order, Added Read/Write and some refactoring.
This commit is contained in:
parent
68a1719794
commit
6ecb969801
|
@ -17,6 +17,8 @@ import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.localization.GuiText;
|
import appeng.core.localization.GuiText;
|
||||||
import appeng.items.AEBaseItem;
|
import appeng.items.AEBaseItem;
|
||||||
|
import appeng.items.contents.CellConfig;
|
||||||
|
import appeng.items.contents.CellUpgrades;
|
||||||
import appeng.items.materials.MaterialType;
|
import appeng.items.materials.MaterialType;
|
||||||
import appeng.me.storage.CellInventory;
|
import appeng.me.storage.CellInventory;
|
||||||
import appeng.me.storage.CellInventoryHandler;
|
import appeng.me.storage.CellInventoryHandler;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import appeng.api.config.FuzzyMode;
|
||||||
import appeng.api.storage.ICellWorkbenchItem;
|
import appeng.api.storage.ICellWorkbenchItem;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.items.AEBaseItem;
|
import appeng.items.AEBaseItem;
|
||||||
|
import appeng.items.contents.CellConfig;
|
||||||
|
|
||||||
public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenchItem
|
public class ItemCreativeStorageCell extends AEBaseItem implements ICellWorkbenchItem
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,8 +14,8 @@ import appeng.api.implementations.items.IAEWrench;
|
||||||
import appeng.api.networking.IGridHost;
|
import appeng.api.networking.IGridHost;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
import appeng.helpers.NetworkToolViewer;
|
|
||||||
import appeng.items.AEBaseItem;
|
import appeng.items.AEBaseItem;
|
||||||
|
import appeng.items.contents.NetworkToolViewer;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
import buildcraft.api.tools.IToolWrench;
|
import buildcraft.api.tools.IToolWrench;
|
||||||
import cpw.mods.fml.common.Optional.Interface;
|
import cpw.mods.fml.common.Optional.Interface;
|
||||||
|
|
|
@ -34,8 +34,8 @@ import appeng.core.features.AEFeature;
|
||||||
import appeng.core.localization.GuiText;
|
import appeng.core.localization.GuiText;
|
||||||
import appeng.core.localization.PlayerMessages;
|
import appeng.core.localization.PlayerMessages;
|
||||||
import appeng.core.sync.packets.PacketMatterCannon;
|
import appeng.core.sync.packets.PacketMatterCannon;
|
||||||
import appeng.items.storage.CellConfig;
|
import appeng.items.contents.CellConfig;
|
||||||
import appeng.items.storage.CellUpgrades;
|
import appeng.items.contents.CellUpgrades;
|
||||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||||
import appeng.me.storage.CellInventory;
|
import appeng.me.storage.CellInventory;
|
||||||
import appeng.me.storage.CellInventoryHandler;
|
import appeng.me.storage.CellInventoryHandler;
|
||||||
|
|
|
@ -20,9 +20,9 @@ import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.core.features.AEFeature;
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.localization.GuiText;
|
import appeng.core.localization.GuiText;
|
||||||
import appeng.core.sync.GuiBridge;
|
import appeng.core.sync.GuiBridge;
|
||||||
import appeng.helpers.PortableCellViewer;
|
import appeng.items.contents.CellConfig;
|
||||||
import appeng.items.storage.CellConfig;
|
import appeng.items.contents.CellUpgrades;
|
||||||
import appeng.items.storage.CellUpgrades;
|
import appeng.items.contents.PortableCellViewer;
|
||||||
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
import appeng.items.tools.powered.powersink.AEBasePoweredItem;
|
||||||
import appeng.me.storage.CellInventory;
|
import appeng.me.storage.CellInventory;
|
||||||
import appeng.me.storage.CellInventoryHandler;
|
import appeng.me.storage.CellInventoryHandler;
|
||||||
|
|
|
@ -9,7 +9,7 @@ import appeng.api.storage.IMEInventoryHandler;
|
||||||
import appeng.api.storage.StorageChannel;
|
import appeng.api.storage.StorageChannel;
|
||||||
import appeng.api.storage.data.IAEItemStack;
|
import appeng.api.storage.data.IAEItemStack;
|
||||||
import appeng.api.storage.data.IItemList;
|
import appeng.api.storage.data.IItemList;
|
||||||
import appeng.items.storage.CellConfig;
|
import appeng.items.contents.CellConfig;
|
||||||
import appeng.util.item.AEItemStack;
|
import appeng.util.item.AEItemStack;
|
||||||
import appeng.util.item.ItemList;
|
import appeng.util.item.ItemList;
|
||||||
|
|
||||||
|
|
|
@ -45,16 +45,18 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||||
@Override
|
@Override
|
||||||
public T extractItems(T request, Actionable type, BaseActionSource src)
|
public T extractItems(T request, Actionable type, BaseActionSource src)
|
||||||
{
|
{
|
||||||
|
if ( !getAccess().hasPermission( AccessRestriction.READ ) )
|
||||||
|
return null;
|
||||||
|
|
||||||
return internal.extractItems( request, type, src );
|
return internal.extractItems( request, type, src );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IItemList<T> getAvailableItems(IItemList out)
|
public IItemList<T> getAvailableItems(IItemList out)
|
||||||
{/*
|
{
|
||||||
* if ( monitor != null ) { for (T is : monitor.getStorageList()) out.add( is );
|
if ( !getAccess().hasPermission( AccessRestriction.READ ) )
|
||||||
*
|
return out;
|
||||||
* return out; } else
|
|
||||||
*/
|
|
||||||
return internal.getAvailableItems( out );
|
return internal.getAvailableItems( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +83,9 @@ public class MEInventoryHandler<T extends IAEStack<T>> implements IMEInventoryHa
|
||||||
@Override
|
@Override
|
||||||
public boolean canAccept(T input)
|
public boolean canAccept(T input)
|
||||||
{
|
{
|
||||||
|
if ( !getAccess().hasPermission( AccessRestriction.WRITE ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
if ( myWhitelist == IncludeExclude.BLACKLIST && myPartitionList.isListed( input ) )
|
if ( myWhitelist == IncludeExclude.BLACKLIST && myPartitionList.isListed( input ) )
|
||||||
return false;
|
return false;
|
||||||
if ( myPartitionList.isEmpty() || myWhitelist == IncludeExclude.BLACKLIST )
|
if ( myPartitionList.isEmpty() || myWhitelist == IncludeExclude.BLACKLIST )
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class NetworkInventoryHandler<T extends IAEStack<T>> implements IMEInvent
|
||||||
@Override
|
@Override
|
||||||
public int compare(Integer o1, Integer o2)
|
public int compare(Integer o1, Integer o2)
|
||||||
{
|
{
|
||||||
return o1 - o2;
|
return o2 - o1;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue