Пример #1
0
        static void BedrockHandler(HypercubeMap map, string[] args)
        {
            map.CWMap.BlockData = new byte[map.CWMap.BlockData.Length];

            var airBlock = ServerCore.Blockholder.GetBlock(0);
            var bedrock = ServerCore.Blockholder.GetBlock(7);

            for (var ix = 0; ix < map.CWMap.SizeX; ix++) {
                for (var iy = 0; iy < map.CWMap.SizeY; iy++)
                    map.BlockChange(-1, (short)ix, (short)iy, 0, bedrock, airBlock, false, false, false, 1);
            }

            for (var ix = 0; ix < map.CWMap.SizeX; ix++) {
                for (var iz = 0; iz < map.CWMap.SizeZ / 2; iz++) {
                    map.BlockChange(-1, (short)ix, 0, (short)iz, bedrock, airBlock, false, false, false, 1);
                    map.BlockChange(-1, (short)ix, (short)(map.CWMap.SizeY - 1), (short)iz, bedrock, airBlock, false, false, false, 1);
                }
            }

            for (var iy = 0; iy < map.CWMap.SizeY; iy++) {
                for (var iz = 0; iz < map.CWMap.SizeZ / 2; iz++) {
                    map.BlockChange(-1, 0, (short)iy, (short)iz, bedrock, airBlock, false, false, false, 1);
                    map.BlockChange(-1, (short)(map.CWMap.SizeX - 1), (short)iy, (short)iz, bedrock, airBlock, false, false, false, 1);
                }
            }

            Chat.SendMapChat(map, "&cMap done.");
        }
Пример #2
0
        static void FlatgrassHandler(HypercubeMap map, string[] args)
        {
            var sw = new Stopwatch();
            sw.Start();

            map.CWMap.BlockData = new byte[map.CWMap.BlockData.Length];

            var grassBlock = ServerCore.Blockholder.GetBlock(2);
            var dirtBlock = ServerCore.Blockholder.GetBlock(3);
            var airBlock = ServerCore.Blockholder.GetBlock(0);

            for (var x = 0; x < map.CWMap.SizeX; x++) {
                for (var y = 0; y < map.CWMap.SizeZ; y++) {
                    for (var z = 0; z < (map.CWMap.SizeY / 2); z++) {
                        map.BlockChange(-1, (short) x, (short) y, (short) z,
                            z == (map.CWMap.SizeY/2) - 1 ? grassBlock : dirtBlock, airBlock, false, false, false, 1);
                    }
                }
            }

            sw.Stop();
            Chat.SendMapChat(map, "&cMap created in " + ((sw.ElapsedMilliseconds / 1000F)) + "s.");
        }
Пример #3
0
        static void WireworldHandler(HypercubeMap map, string[] args)
        {
            map.CWMap.BlockData = new byte[map.CWMap.BlockData.Length];

            var airBlock = ServerCore.Blockholder.GetBlock(0);
            var blackBlock = ServerCore.Blockholder.GetBlock(34);

            for (var x = 0; x < map.CWMap.SizeX; x++) {
                for (var y = 0; y < map.CWMap.SizeY; y++)
                    map.BlockChange(-1, (short)x, (short)y, 0, blackBlock, airBlock, false, false, false, 1);
            }

            Chat.SendMapChat(map, "&cMap done.");
        }
Пример #4
0
 // -- These functions will provide Lua scripts an interface with the server
 // -- Allowing them to have a great deal on control over the server itself.
 public void Setblock(short clientId, HypercubeMap map, short x, short y, short z, byte type, bool undo, bool physics, bool send, short priority)
 {
     map.BlockChange(clientId, x, y, z, ServerCore.Blockholder.GetBlock(type), map.GetBlock(x, y, z), undo, physics, send, priority);
 }