Java 类net.minecraft.network.play.server.SPacketJoinGame 实例源码

项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(SPacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.player.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.player.setEntityId(packetIn.getPlayerId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.player.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(SPacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), packetIn.getDimension(), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.player.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.player.setEntityId(packetIn.getPlayerId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.player.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
项目:CustomWorldGen    文件:NetHandlerPlayClient.java   
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(SPacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.thePlayer.setEntityId(packetIn.getPlayerId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
项目:morecommands    文件:PatchEntityPlayerSP.java   
@Override
public void handleJoinGame(SPacketJoinGame packetIn) {
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.mc);
    if (clientWorldController == null) super.handleJoinGame(packetIn);
       this.mc.playerController = new PlayerControllerMP(this.mc, this); //Replaces the playerController with my own patched PlayerControllerMP
       ReflectionHelper.set(ObfuscatedField.NetHandlerPlayClient_clientWorldController, clientWorldController, this, new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.mc.mcProfiler));
       this.mc.gameSettings.difficulty = packetIn.getDifficulty();
       this.mc.loadWorld(ReflectionHelper.get(ObfuscatedField.NetHandlerPlayClient_clientWorldController, clientWorldController, this));
       this.mc.player.dimension = packetIn.getDimension();
       this.mc.displayGuiScreen(new GuiDownloadTerrain());
       this.mc.player.setEntityId(packetIn.getPlayerId());
       this.currentServerMaxPlayers = packetIn.getMaxPlayers();
       this.mc.player.setReducedDebug(packetIn.isReducedDebugInfo());
       this.mc.playerController.setGameType(packetIn.getGameType());
       this.mc.gameSettings.sendSettingsToServer();
       this.getNetworkManager().sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
   }
项目:ExpandedRailsMod    文件:NetHandlerPlayClient.java   
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
public void handleJoinGame(SPacketJoinGame packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
    this.gameController.playerController = new PlayerControllerMP(this.gameController, this);
    this.clientWorldController = new WorldClient(this, new WorldSettings(0L, packetIn.getGameType(), false, packetIn.isHardcoreMode(), packetIn.getWorldType()), net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.get(getNetworkManager()).getOverrideDimension(packetIn), packetIn.getDifficulty(), this.gameController.mcProfiler);
    this.gameController.gameSettings.difficulty = packetIn.getDifficulty();
    this.gameController.loadWorld(this.clientWorldController);
    this.gameController.thePlayer.dimension = packetIn.getDimension();
    this.gameController.displayGuiScreen(new GuiDownloadTerrain(this));
    this.gameController.thePlayer.setEntityId(packetIn.getPlayerId());
    this.currentServerMaxPlayers = packetIn.getMaxPlayers();
    this.gameController.thePlayer.setReducedDebug(packetIn.isReducedDebugInfo());
    this.gameController.playerController.setGameType(packetIn.getGameType());
    this.gameController.gameSettings.sendSettingsToServer();
    this.netManager.sendPacket(new CPacketCustomPayload("MC|Brand", (new PacketBuffer(Unpooled.buffer())).writeString(ClientBrandRetriever.getClientModName())));
}
项目:CustomWorldGen    文件:NetworkDispatcher.java   
private boolean handleVanilla(Packet<?> msg)
{
    if (state == ConnectionState.AWAITING_HANDSHAKE && msg instanceof SPacketJoinGame)
    {
        handshakeChannel.pipeline().fireUserEventTriggered(msg);
    }
    else
    {
        FMLLog.info("Unexpected packet during modded negotiation - assuming vanilla or keepalives : %s", msg.getClass().getName());
    }
    return false;
}
项目:CustomWorldGen    文件:NetworkDispatcher.java   
public int getOverrideDimension(SPacketJoinGame packetIn) {
    FMLLog.fine("Overriding dimension: using %d", this.overrideLoginDim);
    return this.overrideLoginDim != 0 ? this.overrideLoginDim : packetIn.getDimension();
}
项目:TabbyChat-2    文件:LiteModTabbyChat.java   
@Override
public void onJoinGame(INetHandler iNet, SPacketJoinGame packet, ServerData serverData, RealmsServer realms) {
    NetHandlerPlayClient play = (NetHandlerPlayClient) iNet;
    SocketAddress addr = null;
    if (!play.getNetworkManager().isLocalChannel()) {
        addr = play.getNetworkManager().getRemoteAddress();
    }
    tc.onJoin(addr);
}
项目:UniversalRemote    文件:JoinGameInterceptor.java   
@Override
protected void channelRead0(ChannelHandlerContext ctx, SPacketJoinGame msg) throws Exception {

       if (ctx.channel().isOpen())
       {
           try
           {

            try {

                NetHandlerPlayClient handler = (NetHandlerPlayClient) m_manager.getNetHandler();

                Minecraft scheduler = InjectionHandler.readFieldOfType(handler, Minecraft.class);

                if (!scheduler.isCallingFromMinecraftThread())
                {
                    scheduler.addScheduledTask(new Runnable()
                    {
                        public void run()
                        {
                            invoke(msg);
                        }
                    });
                    throw ThreadQuickExitException.INSTANCE;
                } else {
                    invoke(msg);
                }

            } catch (Exception e) {

                if (e instanceof ThreadQuickExitException) throw e;

                Util.logger.logException("Unable to get scheduler!", e);

                // we died - let vanilla take over!
                ctx.fireChannelRead(msg);
                return;
            }



           }
           catch (ThreadQuickExitException var4)
           {
               ;
           }
       }

}
项目:MnM-Utils    文件:LiteModMnmUtils.java   
@Override
public void onJoinGame(INetHandler netHandler, SPacketJoinGame joinGamePacket, ServerData serverData, RealmsServer realmsServer) {
    UpdateChecker.runUpdateChecks(utils.getChatProxy(), utils.getDisabledUpdates());
}
项目:Backmemed    文件:INetHandlerPlayClient.java   
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
void handleJoinGame(SPacketJoinGame packetIn);
项目:CustomWorldGen    文件:INetHandlerPlayClient.java   
/**
 * Registers some server properties (gametype,hardcore-mode,terraintype,difficulty,player limit), creates a new
 * WorldClient and sets the player initial dimension
 */
void handleJoinGame(SPacketJoinGame packetIn);