Beispiel #1
0
        public void doLogin(Packet1Login packet1login)
        {
            EntityPlayerMP entityplayermp = mcServer.configManager.login(this, packet1login.username,
                                                                         packet1login.password);

            if (entityplayermp != null)
            {
                logger.info(
                    (new StringBuilder()).append(getUserAndIPString()).append(" logged in with entity id ").append(
                        entityplayermp.entityId).toString());
                ChunkCoordinates chunkcoordinates = mcServer.worldMngr.func_22078_l();
                var netserverhandler = new NetServerHandler(mcServer, netManager, entityplayermp);
                netserverhandler.sendPacket(new Packet1Login("", "", entityplayermp.entityId,
                                                             mcServer.worldMngr.func_22079_j(),
                                                             (byte)mcServer.worldMngr.worldProvider.worldType));
                netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY,
                                                                     chunkcoordinates.posZ));
                mcServer.configManager.sendPacketToAllPlayers(
                    new Packet3Chat(
                        (new StringBuilder()).append("§e").append(entityplayermp.username).append(" joined the game.").
                        toString()));
                mcServer.configManager.playerLoggedIn(entityplayermp);
                netserverhandler.teleportTo(entityplayermp.posX, entityplayermp.posY, entityplayermp.posZ,
                                            entityplayermp.rotationYaw, entityplayermp.rotationPitch);
                mcServer.networkServer.addPlayer(netserverhandler);
                netserverhandler.sendPacket(new Packet4UpdateTime(mcServer.worldMngr.getWorldTime()));
                entityplayermp.func_20057_k();
            }
            finishedProcessing = true;
        }
Beispiel #2
0
 public void doLogin(Packet1Login packet1login)
 {
     EntityPlayerMP entityplayermp = mcServer.configManager.login(this, packet1login.username,
                                                                  packet1login.password);
     if (entityplayermp != null)
     {
         logger.info(
             (new StringBuilder()).append(getUserAndIPString()).append(" logged in with entity id ").append(
                 entityplayermp.entityId).toString());
         ChunkCoordinates chunkcoordinates = mcServer.worldMngr.func_22078_l();
         var netserverhandler = new NetServerHandler(mcServer, netManager, entityplayermp);
         netserverhandler.sendPacket(new Packet1Login("", "", entityplayermp.entityId,
                                                      mcServer.worldMngr.func_22079_j(),
                                                      (byte) mcServer.worldMngr.worldProvider.worldType));
         netserverhandler.sendPacket(new Packet6SpawnPosition(chunkcoordinates.posX, chunkcoordinates.posY,
                                                              chunkcoordinates.posZ));
         mcServer.configManager.sendPacketToAllPlayers(
             new Packet3Chat(
                 (new StringBuilder()).append("§e").append(entityplayermp.username).append(" joined the game.").
                     toString()));
         mcServer.configManager.playerLoggedIn(entityplayermp);
         netserverhandler.teleportTo(entityplayermp.posX, entityplayermp.posY, entityplayermp.posZ,
                                     entityplayermp.rotationYaw, entityplayermp.rotationPitch);
         mcServer.networkServer.addPlayer(netserverhandler);
         netserverhandler.sendPacket(new Packet4UpdateTime(mcServer.worldMngr.getWorldTime()));
         entityplayermp.func_20057_k();
     }
     finishedProcessing = true;
 }
Beispiel #3
0
 public void updateCraftingInventorySlot(CraftingInventoryCB craftinginventorycb, int i, ItemStack itemstack)
 {
     if (craftinginventorycb.getSlot(i) is SlotCrafting)
     {
         return;
     }
     if (isChangingQuantityOnly)
     {
         return;
     }
     else
     {
         playerNetServerHandler.sendPacket(new Packet103(craftinginventorycb.windowId, i, itemstack));
         return;
     }
 }