Created
July 4, 2014 21:13
-
-
Save WillR27/1bc97353f1f901987d00 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.blocklings.network; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.buffer.ByteBufInputStream; | |
import java.io.IOException; | |
import net.minecraft.entity.player.EntityPlayerMP; | |
import com.blocklings.main.Blocklings; | |
import cpw.mods.fml.relauncher.Side; | |
public class ProcessPacketServerSide { | |
public ProcessPacketServerSide() { | |
} | |
public static void processPacketOnServer(ByteBuf parBB, Side parSide, EntityPlayerMP parPlayer) throws IOException { | |
if (parSide == Side.SERVER) | |
{ | |
System.out.println("Received Packet on Server Side from Player = " + parPlayer.getEntityId()); | |
ByteBufInputStream bbis = new ByteBufInputStream(parBB); | |
int packetTypeID = bbis.readInt(); | |
System.out.println("Packet type ID = " + packetTypeID); | |
switch (packetTypeID) { | |
case Blocklings.PACKET_TYPE_C2S_TEST: { | |
int testVal = bbis.readInt(); | |
break; | |
} | |
} | |
bbis.close(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment