• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# SMP.World类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SMP.World的典型用法代码示例。如果您正苦于以下问题:C# World类的具体用法?C# World怎么用?C# World使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



World类属于SMP命名空间,在下文中一共展示了World类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Server

        public Server()
        {
            Log("Starting Server");
            s = this;
            consolePlayer = new ConsolePlayer(s);
            consolePlayer.SetUsername(ConsoleName);
            //Group.DefaultGroup = new DefaultGroup(); //debugging
            mainlevel = new World(0, 127, 0, "main", new Random().Next());
            World.worlds.Add(mainlevel);
            ml = new MainLoop("server");
            #region updatetimer
            ml.Queue(delegate
            {
                updateTimer.Elapsed += delegate
                {
                Player.GlobalUpdate();
                }; updateTimer.Start();
            });
            #endregion
            //TODO AI Update Timer

            //Setup();

            Log("Server Started");

            //new Creeper(new Point3(0, 0, 0), mainlevel);
        }
开发者ID:jamesphenry,项目名称:ForgeCraft,代码行数:27,代码来源:Server.cs


示例2: Item

 public Item(Items item, World l, bool inv = false)
 {
     isInventory = inv;
     e = new Entity(this, l);
     this.id = (short)item;
     OnGround = false;
 }
开发者ID:Shade2010,项目名称:ForgeCraft,代码行数:7,代码来源:Item.cs


示例3: ChunkLoadQueue

 public ChunkLoadQueue(int x, int z, bool unload, World world)
 {
     this.x = x;
     this.z = z;
     this.unload = unload;
     this.world = world;
 }
开发者ID:eszanto8,项目名称:ForgeCraft,代码行数:7,代码来源:Chunker.cs


示例4: Use

 public override void Use(Player p, params string[] args)
 {
     if (args.Length == 0) { Help(p); return; }
     else if (args.Length == 1)
     {
         Random rand = new Random();
         int seed = new Random().Next();
         p.SendMessage("Creating world with seed: " + seed);
         double x = 0; double y = 127; double z = 0;
         World temp = new World(x, y, z, args[0], seed);
         //while (Chunk.GetChunk((int)x, (int)z, temp).GetBlock((int)x, (int)(y - 1), (int)z) == 0)
         //	y--;
         temp.SpawnY = y;
         World.worlds.Add(temp);
         p.SendMessage("World " + args[0] + " MADE!");
     }
     else if (args.Length == 2 || args.Length == 3)
     {
         int seed = Convert.ToInt32(args[1]);
         p.SendMessage("Creating world with seed: " + seed);
         double x = 0; double y = 127; double z = 0;
         World temp = new World(x, y, z, args[0], seed);
         if (args.Length == 3)
         {
             int limit = Convert.ToInt32(args[2]);
             if (limit > 2)
                 temp.ChunkLimit = limit;
             else { p.SendMessage("maxchunks cannot be less than 3. creating with maxchunks 3."); temp.ChunkLimit = 3; }
         }
         World.worlds.Add(temp);
         p.SendMessage("World " + args[0] + " MADE!");
     }
 }
开发者ID:RevolutionSmythe,项目名称:ForgeCraft,代码行数:33,代码来源:CmdNewLVL.cs


示例5: Physics

 public Physics(World w, PSetting setting, int speed)
 {
     this.w = w;
     this.setting = setting;
     this.speed = speed;
     this.random = new Random();
 }
开发者ID:Shade2010,项目名称:ForgeCraft,代码行数:7,代码来源:Physics.cs


示例6: Creeper

        public Creeper(Point3 pos, World level)
        {
            mye = new Entity(this, level);
            mylevel = level;
            e.pos = pos;

            e.UpdateChunks(false, false);
        }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:8,代码来源:Creeper.cs


示例7: ContainerChest

 public ContainerChest(World level, Point3 point)
 {
     this.level = level;
     this.point = point;
     items = new Item[Size];
     for (int i = 0; i < Size; i++)
         items[i] = Item.Nothing;
 }
开发者ID:TaFinalDestination,项目名称:ForgeCraft,代码行数:8,代码来源:ContainerChest.cs


示例8: ChunkGenQueue

 public ChunkGenQueue(int x, int z, World world, bool generate = true, bool populate = true)
 {
     this.generate = generate;
     this.populate = populate;
     this.x = x;
     this.z = z;
     this.world = world;
 }
开发者ID:Cazzar,项目名称:ForgeCraft,代码行数:8,代码来源:Chunker.cs


示例9: Item

 public Item(short item, byte count, short meta, World l)
 {
     this.item = (short)item;
     this.meta = meta;
     this.count = count;
     OnGround = false;
     e = new Entity(this, l);
 }
开发者ID:jamesphenry,项目名称:ForgeCraft,代码行数:8,代码来源:Item.cs


示例10: WorldChunkManager

 public WorldChunkManager(World world)
     : this()
 {
     GenLayer[] agenlayer = GenLayer.func_35019_a(world.seed);
     field_34907_a = agenlayer[0];
     field_34906_b = agenlayer[1];
     temperatureLayer = agenlayer[2];
     rainfallLayer = agenlayer[3];
 }
开发者ID:Nerketur,项目名称:ForgeCraft,代码行数:9,代码来源:WorldChunkManager.cs


示例11: Entity

        public Entity(AI ai, World l)
        {
            this.ai = ai;
            id = FreeId();
            isAI = true;
            level = l;

            Entities.Add(id, this);
        }
开发者ID:ProLoks,项目名称:ForgeCraft,代码行数:9,代码来源:Entity.cs


示例12: Entity

        public Entity(Player pl, World l)
            : this(l)
        {
            p = pl;
            isPlayer = true;

            UpdateChunks(false, false);

            Entities.Add(id, this);
        }
开发者ID:Cazzar,项目名称:ForgeCraft,代码行数:10,代码来源:Entity.cs


示例13: Item

 public Item(short item, byte count, short meta, World l, double[] pos, byte[] rot)
 {
     this.item = item;
     this.count = count;
     this.meta = meta;
     this.level = l;
     this.pos = pos;
     this.rot = rot;
     OnGround = true;
     e = new Entity(this, l);
     e.UpdateChunks(false, false);
 }
开发者ID:ProLoks,项目名称:ForgeCraft,代码行数:12,代码来源:Item.cs


示例14: Explosion

 public Explosion(World world, /*Entity entity,*/ double d, double d1, double d2, float f)
 {
     isFlaming = false;
     ExplosionRNG = new Random();
     destroyedBlockPositions = new HashSet<Point3>();
     worldObj = world;
     //exploder = entity; // Not needed right now
     explosionSize = f;
     explosionX = d;
     explosionY = d1;
     explosionZ = d2;
 }
开发者ID:eszanto8,项目名称:ForgeCraft,代码行数:12,代码来源:Explosion.cs


示例15: Entity

        public Entity(Item i, World l)
        {
            I = i;
            if (!I.isInventory) id = FreeId();
            isItem = true;
            level = l;

            if (!I.isInventory)
            {
                UpdateChunks(false, false);
                Entities.Add(id, this);
            }
        }
开发者ID:Shade2010,项目名称:ForgeCraft,代码行数:13,代码来源:Entity.cs


示例16: Windows

        byte type; //This holds type information, used in deciding which kind of window we need to send.

        #endregion Fields

        #region Constructors

        public Windows(WindowType type, Point3 pos, World world, Player p)
        {
            try
            {
                id = FreeId();
                this.type = (byte)type;
                this.p = p;

                switch (Type)
                {
                    case WindowType.Chest:
                        name = "Chest"; //We change this to "Large Chest" Later if it needs it :3
                        container = world.GetBlockContainer(pos);
                        items = container.Items;
                        container.AddPlayer(p);
                        break;
                    case WindowType.Dispenser:
                        name = "Workbench";
                        //container = world.GetBlockContainer(pos); // We don't have a container for this yet.
                        items = new Item[9];
                        break;
                    case WindowType.Furnace:
                        name = "Furnace";
                        //container = world.GetBlockContainer(pos); // We don't have a container for this yet.
                        items = new Item[3];
                        break;
                    case WindowType.Workbench:
                        name = "Dispenser";
                        items = new Item[10];
                        break;
                    case WindowType.EnchantmentTable:
                        name = "Enchant";
                        items = new Item[1];
                        break;
                    case WindowType.BrewingStand:
                        name = "Brewing Stand";
                        //container = world.GetBlockContainer(pos); // We don't have a container for this yet.
                        items = new Item[4];
                        break;
                }

                if (Type == WindowType.Workbench || Type == WindowType.EnchantmentTable)
                {
                    for (int i = 0; i < InventorySize; i++)
                        items[i] = Item.Nothing;
                }
            }
            catch { Logger.Log("Error making window!"); }
        }
开发者ID:Cazzar,项目名称:ForgeCraft,代码行数:55,代码来源:Windows.cs


示例17: CancelEvent

 /// <summary>
 /// Cancel a World Event
 /// </summary>
 /// <param name="e">The event to cancel</param>
 /// <param name="w">The world</param>
 public static void CancelEvent(LevelEvent e, World w)
 {
     switch (e)
     {
         case LevelEvent.PhysicsUpdate:
             w.physics.cancelphysics = true;
             break;
         case LevelEvent.Save:
             World.cancelsave = true;
             break;
         case LevelEvent.ChunkGenerated:
             w.cancelchunk = true;
             break;
     }
 }
开发者ID:Shade2010,项目名称:ForgeCraft,代码行数:20,代码来源:Plugin.Events.cs


示例18: Use

 public override void Use(Player p, params string[] args)
 {
     if (args.Length == 0) { Help(p); return; }
     else if (args.Length == 1)
     {
         Random rand = new Random();
         long seed = new Random().Next();
         p.SendMessage("Creating world with seed: " + seed);
         double x = rand.Next(50); double y = 64; double z = rand.Next(50);
         World temp = new World(x, y, z, args[0]);
         //while (Chunk.GetChunk((int)x, (int)z, temp).GetBlock((int)x, (int)(y - 1), (int)z) == 0)
         //	y--;
         temp.SpawnY = y;
         World.worlds.Add(temp);
         p.SendMessage("World " + args[0] + " MADE!");
     }
 }
开发者ID:philipdenseje,项目名称:ForgeCraft,代码行数:17,代码来源:NewLVL.cs


示例19: CreateInstance

 public static Container CreateInstance(ContainerType type, World level, Point3 point)
 {
     switch (type)
     {
         case ContainerType.Chest:
             return new ContainerChest(level, point);
         case ContainerType.Furnace:
             // TODO
             break;
         case ContainerType.Dispenser:
             // TODO
             break;
         case ContainerType.BrewingStand:
             // TODO
             break;
     }
     return null;
 }
开发者ID:Cazzar,项目名称:ForgeCraft,代码行数:18,代码来源:Container.cs


示例20: generate

        public virtual void generate(World world, int i, int j, byte[] abyte0)
        {
            int k = field_947_a;
            field_35530_d = world;
            rand = new java.util.Random(world.seed);
            long l = rand.nextLong();
            long l1 = rand.nextLong();
            for(int i1 = i - k; i1 <= i + k; i1++)
            {
                for(int j1 = j - k; j1 <= j + k; j1++)
                {
                    long l2 = (long)i1 * l;
                    long l3 = (long)j1 * l1;
                    rand = new java.util.Random(l2 ^ l3 ^ world.seed);
                    recursiveGenerate(world, i1, j1, i, j, abyte0);
                }

            }
        }
开发者ID:eszanto8,项目名称:ForgeCraft,代码行数:19,代码来源:GenFeatures.cs



注:本文中的SMP.World类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# FrameworkUI.EntityBrowser类代码示例发布时间:2022-05-26
下一篇:
C# SMP.Player类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap