Пример #1
0
        public static void UpdateSign(MinecraftClient client, IPacket _packet)
        {
            var packet   = (UpdateSignPacket)_packet;
            var position = new Vector3(packet.X, packet.Y, packet.Z);

            var signTileEntity = new SignTileEntity
            {
                Text1 = packet.Text1,
                Text2 = packet.Text2,
                Text3 = packet.Text3,
                Text4 = packet.Text4
            };

            client.OnSignUpdateReceived(new SignUpdateReceivedEventArgs(position, signTileEntity));

            var chunk = client.World.GetChunk(position);

            if (chunk == null || chunk.Chunk == null)
            {
                return;
            }

            chunk.Chunk.TileEntities[position] = signTileEntity;
        }
Пример #2
0
        public static void UpdateSign(MinecraftClient client, IPacket _packet)
        {
            var packet = (UpdateSignPacket)_packet;
            var position = new Vector3(packet.X, packet.Y, packet.Z);
            
            var signTileEntity = new SignTileEntity
            {
                Text1 = packet.Text1,
                Text2 = packet.Text2,
                Text3 = packet.Text3,
                Text4 = packet.Text4
            };

            client.OnSignUpdateReceived(new SignUpdateReceivedEventArgs(position, signTileEntity));

            var chunk = client.World.GetChunk(position);
            if (chunk == null || chunk.Chunk == null) return;

            chunk.Chunk.TileEntities[position] = signTileEntity;
        }