Removed Dropped Features.
Implemented Spatial Storage. Fixed bug with ME Chest saying the cell was un-readable.
This commit is contained in:
@@ -17,6 +17,7 @@ import appeng.core.sync.packets.PacketMEInventoryUpdate;
|
||||
import appeng.core.sync.packets.PacketMatterCannon;
|
||||
import appeng.core.sync.packets.PacketMockExplosion;
|
||||
import appeng.core.sync.packets.PacketMultiPart;
|
||||
import appeng.core.sync.packets.PacketNewStorageDimension;
|
||||
import appeng.core.sync.packets.PacketPartPlacement;
|
||||
import appeng.core.sync.packets.PacketProgressBar;
|
||||
import appeng.core.sync.packets.PacketSwitchGuis;
|
||||
@@ -58,6 +59,8 @@ public class AppEngPacketHandlerBase
|
||||
|
||||
PACKET_CLICK(PacketClick.class),
|
||||
|
||||
PACKET_NEW_STORAGE_DIMENSION(PacketNewStorageDimension.class),
|
||||
|
||||
PACKET_SWITCH_GUIS(PacketSwitchGuis.class);
|
||||
|
||||
final public Class pc;
|
||||
|
||||
@@ -46,6 +46,7 @@ import appeng.container.implementations.ContainerPriority;
|
||||
import appeng.container.implementations.ContainerQNB;
|
||||
import appeng.container.implementations.ContainerSecurity;
|
||||
import appeng.container.implementations.ContainerSkyChest;
|
||||
import appeng.container.implementations.ContainerSpatialIOPort;
|
||||
import appeng.container.implementations.ContainerStorageBus;
|
||||
import appeng.container.implementations.ContainerUpgradeable;
|
||||
import appeng.container.implementations.ContainerVibrationChamber;
|
||||
@@ -66,6 +67,7 @@ import appeng.tile.misc.TileSecurity;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.tile.spatial.TileSpatialIOPort;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
@@ -123,6 +125,10 @@ public enum GuiBridge implements IGuiHandler
|
||||
// extends (Container/Gui) + Bus
|
||||
GUI_LEVELEMITTER(ContainerLevelEmitter.class, PartLevelEmitter.class, false, SecurityPermissions.BUILD),
|
||||
|
||||
GUI_SPATIALIOPORT(ContainerSpatialIOPort.class, TileSpatialIOPort.class, false, SecurityPermissions.BUILD),
|
||||
|
||||
// GUI_INSCRIBER
|
||||
|
||||
GUI_CELLWORKBENCH(ContainerCellWorkbench.class, TileCellWorkbench.class, false, null);
|
||||
|
||||
private Class Tile;
|
||||
|
||||
@@ -4,12 +4,16 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
import appeng.core.WorldSettings;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
||||
import cpw.mods.fml.common.network.FMLEventChannel;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.CustomNetworkEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import cpw.mods.fml.common.network.NetworkHandshakeEstablished;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
public class NetworkHandler
|
||||
{
|
||||
@@ -23,6 +27,7 @@ public class NetworkHandler
|
||||
final IPacketHandler serveHandler;
|
||||
|
||||
public NetworkHandler(String channelName) {
|
||||
FMLCommonHandler.instance().bus().register( this );
|
||||
ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( myChannelName = channelName );
|
||||
ec.register( this );
|
||||
|
||||
@@ -55,9 +60,25 @@ public class NetworkHandler
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void newPlayer(PlayerLoggedInEvent ev)
|
||||
public void newConection(CustomNetworkEvent cctse)
|
||||
{
|
||||
WorldSettings.getInstance().sendToPlayer( ev.player );
|
||||
if ( cctse.wrappedEvent instanceof NetworkHandshakeEstablished )
|
||||
{
|
||||
NetworkHandshakeEstablished nhe = (NetworkHandshakeEstablished) cctse.wrappedEvent;
|
||||
if ( nhe.side == Side.SERVER && nhe.netHandler instanceof NetHandlerPlayServer )
|
||||
{
|
||||
NetHandlerPlayServer srv = (NetHandlerPlayServer) nhe.netHandler;
|
||||
// WorldSettings.getInstance().sendToPlayer( srv.playerEntity );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void newConection(PlayerLoggedInEvent loginEvent)
|
||||
{
|
||||
if ( loginEvent.player instanceof EntityPlayerMP )
|
||||
WorldSettings.getInstance().sendToPlayer( (EntityPlayerMP) loginEvent.player );
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class PacketNewStorageDimension extends AppEngPacket
|
||||
{
|
||||
|
||||
final int newDim;
|
||||
|
||||
// automatic.
|
||||
public PacketNewStorageDimension(ByteBuf stream) throws IOException {
|
||||
newDim = stream.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
|
||||
{
|
||||
DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID );
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketNewStorageDimension(int newDim) throws IOException {
|
||||
|
||||
this.newDim = newDim;
|
||||
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( getPacketID() );
|
||||
data.writeInt( newDim );
|
||||
|
||||
configureWrite( data );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user