AE2 First Commit, the dawn of 1.7 hast arrived.
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package appeng.core.sync;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import cpw.mods.fml.common.network.IPacketHandler;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
|
||||
public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase implements IPacketHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player)
|
||||
{
|
||||
DataInputStream stream = new DataInputStream( new ByteArrayInputStream( packet.data ) );
|
||||
// Determine packet type and coordinates of affected tile entity
|
||||
int packetType = -1;
|
||||
|
||||
try
|
||||
{
|
||||
packetType = stream.readInt();
|
||||
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
|
||||
pack.serverPacketData( manager, pack, player );
|
||||
} catch (IOException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
} catch (InstantiationException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
} catch (IllegalArgumentException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user