Created
July 4, 2014 21:13
-
-
Save WillR27/92517b2ffd3ec80f421a 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 java.io.IOException; | |
import net.minecraft.entity.player.EntityPlayerMP; | |
import net.minecraft.network.NetHandlerPlayServer; | |
import com.blocklings.main.Blocklings; | |
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | |
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent; | |
public class ServerPacketHandler { | |
protected String channelName; | |
protected EntityPlayerMP thePlayer; | |
@SubscribeEvent | |
public void onServerPacket(ServerCustomPacketEvent event) throws IOException { | |
channelName = event.packet.channel(); | |
NetHandlerPlayServer theNetHandlerPlayServer = (NetHandlerPlayServer) event.handler; | |
thePlayer = theNetHandlerPlayServer.playerEntity; | |
if (channelName.equals(Blocklings.networkChannelName)) { | |
ProcessPacketServerSide.processPacketOnServer(event.packet.payload(),event.packet.getTarget(), thePlayer); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment