Refactoring API stuff

This commit is contained in:
AlgorithmX2
2014-01-23 13:02:48 -06:00
parent dfbc8a6c79
commit 42424f80c8
59 changed files with 105 additions and 142 deletions
@@ -8,7 +8,8 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.network.packet.Packet;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import appeng.api.implementations.IMEChest;
import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.api.implementations.tiles.IMEChest;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridHost;
import appeng.api.networking.IGridNode;
@@ -22,7 +23,6 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.container.AEBaseContainer;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.helpers.ICellItemViewer;
import appeng.util.Platform;
import appeng.util.item.ItemList;
import cpw.mods.fml.common.network.PacketDispatcher;
@@ -44,8 +44,8 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IMEMonito
cellInv = monitor;
if ( montiorable instanceof ICellItemViewer )
powerSrc = (ICellItemViewer) montiorable;
if ( montiorable instanceof IPortableCell )
powerSrc = (IPortableCell) montiorable;
else if ( montiorable instanceof IMEChest )
powerSrc = (IMEChest) montiorable;
else if ( montiorable instanceof IGridHost )
@@ -4,16 +4,16 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import appeng.api.config.Actionable;
import appeng.api.config.PowerMultiplier;
import appeng.api.implementations.guiobjects.IPortableCell;
import appeng.api.storage.IStorageMonitorable;
import appeng.helpers.ICellItemViewer;
import appeng.util.Platform;
public class ContainerMEPortableCell extends ContainerMEMonitorable
{
ICellItemViewer civ;
IPortableCell civ;
public ContainerMEPortableCell(InventoryPlayer ip, ICellItemViewer montiorable) {
public ContainerMEPortableCell(InventoryPlayer ip, IPortableCell montiorable) {
super( ip, (IStorageMonitorable) montiorable, Platform.isServer() );
lockPlayerInventorySlot( ip.currentItem );
civ = montiorable;
@@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.network.packet.Packet;
import net.minecraftforge.common.ForgeDirection;
import appeng.api.AEApi;
import appeng.api.implementations.guiobjects.INetworkTool;
import appeng.api.networking.IGrid;
import appeng.api.networking.IGridBlock;
import appeng.api.networking.IGridHost;
@@ -17,7 +18,6 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import appeng.container.AEBaseContainer;
import appeng.core.sync.packets.PacketMEInventoryUpdate;
import appeng.helpers.INetworkTool;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
import cpw.mods.fml.common.network.PacketDispatcher;
@@ -2,10 +2,10 @@ package appeng.container.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
import appeng.api.implementations.guiobjects.INetworkTool;
import appeng.container.AEBaseContainer;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
import appeng.helpers.INetworkTool;
import appeng.util.Platform;
public class ContainerNetworkTool extends AEBaseContainer
@@ -10,7 +10,7 @@ import appeng.api.config.FuzzyMode;
import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings;
import appeng.api.config.Upgrades;
import appeng.api.implementations.IBusCommon;
import appeng.api.implementations.IUpgradeableHost;
import appeng.api.parts.IPart;
import appeng.container.AEBaseContainer;
import appeng.container.slot.IOptionalSlotHost;
@@ -19,7 +19,7 @@ import appeng.container.slot.OptionalSlotFakeTypeOnly;
import appeng.container.slot.SlotFakeTypeOnly;
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
import appeng.helpers.NetworkToolInv;
import appeng.helpers.NetworkToolViewer;
import appeng.items.tools.ToolNetworkTool;
import appeng.util.Platform;
import cpw.mods.fml.relauncher.Side;
@@ -28,12 +28,12 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSlotHost
{
IBusCommon myte;
IUpgradeableHost myte;
int tbslot;
NetworkToolInv tbinv;
NetworkToolViewer tbinv;
public ContainerUpgradeable(InventoryPlayer ip, IBusCommon te) {
public ContainerUpgradeable(InventoryPlayer ip, IUpgradeableHost te) {
super( ip, (TileEntity) (te instanceof TileEntity ? te : null), (IPart) (te instanceof IPart ? te : null) );
myte = te;
@@ -51,7 +51,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
if ( te instanceof IPart )
{
IBusCommon myTile = (IBusCommon) te;
IUpgradeableHost myTile = (IUpgradeableHost) te;
TileEntity mk = myTile.getTile();
w = mk.getWorldObj();
xCoor = mk.xCoord;
@@ -67,7 +67,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl
{
lockPlayerInventorySlot( x );
tbslot = x;
tbinv = (NetworkToolInv) ((ToolNetworkTool) pii.getItem()).getGuiObject( pii, w, xCoor, yCoor, zCoor );
tbinv = (NetworkToolViewer) ((ToolNetworkTool) pii.getItem()).getGuiObject( pii, w, xCoor, yCoor, zCoor );
break;
}
}