ME Tunnel + Network Tool

This commit is contained in:
AlgorithmX2
2014-01-23 10:28:12 -06:00
parent 1b77755dd6
commit dfbc8a6c79
46 changed files with 929 additions and 128 deletions
+10 -3
View File
@@ -25,12 +25,15 @@ import appeng.container.implementations.ContainerInterface;
import appeng.container.implementations.ContainerLevelEmitter;
import appeng.container.implementations.ContainerMEMonitorable;
import appeng.container.implementations.ContainerMEPortableCell;
import appeng.container.implementations.ContainerNetworkStatus;
import appeng.container.implementations.ContainerNetworkTool;
import appeng.container.implementations.ContainerQNB;
import appeng.container.implementations.ContainerUpgradeable;
import appeng.container.implementations.ContainerVibrationChamber;
import appeng.helpers.ICellItemViewer;
import appeng.helpers.IGuiItem;
import appeng.helpers.IInterfaceHost;
import appeng.helpers.INetworkTool;
import appeng.parts.automation.PartLevelEmitter;
import appeng.tile.grindstone.TileGrinder;
import appeng.tile.misc.TileCellWorkbench;
@@ -58,6 +61,10 @@ public enum GuiBridge implements IGuiHandler
GUI_PORTABLE_CELL(ContainerMEPortableCell.class, ICellItemViewer.class, true),
GUI_NETWORK_STATUS(ContainerNetworkStatus.class, INetworkTool.class, true),
GUI_NETWORK_TOOL(ContainerNetworkTool.class, INetworkTool.class, true),
GUI_DRIVE(ContainerDrive.class, TileDrive.class, false),
GUI_VIBRATIONCHAMBER(ContainerVibrationChamber.class, TileVibrationChamber.class, false),
@@ -166,7 +173,7 @@ public enum GuiBridge implements IGuiHandler
ItemStack it = player.inventory.getCurrentItem();
if ( it != null && it.getItem() instanceof IGuiItem )
{
Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it );
Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it, w, x, y, z );
if ( ID.CorrectTileOrPart( myItem ) )
return ID.ConstructContainer( player.inventory, side, myItem );
}
@@ -191,7 +198,7 @@ public enum GuiBridge implements IGuiHandler
return new ContainerNull();
}
private boolean isItem()
public boolean isItem()
{
return isItem;
}
@@ -207,7 +214,7 @@ public enum GuiBridge implements IGuiHandler
ItemStack it = player.inventory.getCurrentItem();
if ( it != null && it.getItem() instanceof IGuiItem )
{
Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it );
Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it, w, x, y, z );
if ( ID.CorrectTileOrPart( myItem ) )
return ID.ConstructGui( player.inventory, side, myItem );
}
+5 -2
View File
@@ -36,8 +36,11 @@ public class PacketInventoryAction extends AppEngPacket
public void serverPacketData(INetworkManager manager, AppEngPacket packet, EntityPlayer player)
{
EntityPlayerMP sender = (EntityPlayerMP) player;
AEBaseContainer aebc = (AEBaseContainer) sender.openContainer;
aebc.doAction( sender, action, slot, slotItem );
if ( sender.openContainer instanceof AEBaseContainer )
{
AEBaseContainer aebc = (AEBaseContainer) sender.openContainer;
aebc.doAction( sender, action, slot, slotItem );
}
}
// api
@@ -14,6 +14,7 @@ import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.implementations.GuiMEMonitorable;
import appeng.client.gui.implementations.GuiNetworkStatus;
import appeng.core.sync.AppEngPacket;
import appeng.util.item.AEItemStack;
import cpw.mods.fml.relauncher.Side;
@@ -45,10 +46,13 @@ public class PacketMEInventoryUpdate extends AppEngPacket
public void clientPacketData(INetworkManager network, AppEngPacket packet, EntityPlayer player)
{
GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if ( gs instanceof GuiMEMonitorable )
{
((GuiMEMonitorable) gs).postUpdate( list );
}
if ( gs instanceof GuiNetworkStatus )
((GuiNetworkStatus) gs).postUpdate( list );
}
@Override