public void HandleOpenWindow(MinecraftClient client, IPacket packet) {
     var myPacket = (CBOpenWindow)packet;
     client.RaiseOpenWindow(myPacket.Windowid, myPacket.InventoryType, myPacket.Windowtitle, myPacket.NumberofSlots, myPacket.Useprovidedwindowtitle);
     client.RaiseDebug(this, "Window opened forcibly");
 }
        public void HandleJoinGame(MinecraftClient client, IPacket packet) {
            var myPacket = (CBJoinGame)packet;

            if (client.ThisPlayer == null)
                client.ThisPlayer = new Player();

            client.ThisPlayer.Entity_ID = myPacket.EntityID;
            client.ThisPlayer.gameMode = myPacket.Gamemode;

            if (client.MinecraftWorld == null)
                client.MinecraftWorld = new WorldClass();

            client.MinecraftWorld.difficulty = myPacket.Difficulty;
            client.MinecraftWorld.dimension = myPacket.Dimension;
            client.MinecraftWorld.maxPlayers = myPacket.MaxPlayers;
            client.MinecraftWorld.levelType = myPacket.LevelType;

            client.RaiseDebug(this, string.Format("Entity ID: {0}", myPacket.EntityID));
            client.RaiseGameJoined();

            var b = new SBClientSettings();
            b.Locale = "en_US";
            b.Viewdistance = 5;
            b.Chatflags = 3;
            b.Chatcolours = true;
            b.Difficulty = 1;
            b.ShowCape = false;
            b.Write(client.nh.wSock);

            var c = new SBPluginMessage();
            c.Channel = "MC|Brand";
            c.Data = Encoding.UTF8.GetBytes(client.ClientBrand);
            c.Length = (short)c.Data.Length;
            c.Write(client.nh.wSock);
        }
 //TODO: Sign Editor, Sound Effect, SpawnExpOrb
 public void HandleGlobalEntitySpawn(MinecraftClient client, IPacket packet) {
     var myPacket = (CBSpawnGlobalEntity)packet;
     client.RaiseDebug(this, "A thunderbolt struck at " + myPacket.X + " " + myPacket.Y + " " + myPacket.Z);
 }
        public void HandleLoginSuccess(MinecraftClient client, IPacket packet) {
            var Success = (CBLoginSuccess)packet;
            client.RaiseLoginSuccess(this);
            client.RaiseDebug(this, "UUID: " + Success.UUID + " Username: "******"The server state is now 3 (Play)");
        }
        public void HandleJoinGame(MinecraftClient client, IPacket packet) {
            var myPacket = (CbJoinGame)packet;

            if (client.ThisPlayer == null)
                client.ThisPlayer = new Player();

            client.ThisPlayer.EntityId = myPacket.EntityId;
            client.ThisPlayer.GameMode = myPacket.Gamemode;

            if (client.MinecraftWorld == null)
                client.MinecraftWorld = new WorldClass();

            client.MinecraftWorld.Difficulty = myPacket.Difficulty;
            client.MinecraftWorld.Dimension = myPacket.Dimension;
            client.MinecraftWorld.MaxPlayers = myPacket.MaxPlayers;
            client.MinecraftWorld.LevelType = myPacket.LevelType;

            client.RaiseDebug(this, string.Format("Entity ID: {0}", myPacket.EntityId));
            client.RaiseGameJoined();

            var b = new SbClientSettings
            {
                Locale = "en_US",
                Viewdistance = 5,
                Chatflags = 3,
                Chatcolours = true,
                Difficulty = 1,
                ShowCape = false
            };
            b.Write(client.Nh.WSock);

            var c = new SbPluginMessage {Channel = "MC|Brand", Data = Encoding.UTF8.GetBytes(client.ClientBrand)};
            c.Length = (short)c.Data.Length;
            c.Write(client.Nh.WSock);
        }