当前位置: 首页>>代码示例>>C#>>正文


C# World.getWorldTime方法代码示例

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


在下文中一共展示了World.getWorldTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: checkForBurnout

        private bool checkForBurnout(World world, int i, int j, int k, bool flag)
        {
            if (flag)
            {
                torchUpdates.add(new RedstoneUpdateInfo(i, j, k, world.getWorldTime()));
            }
            int l = 0;
            for (int i1 = 0; i1 < torchUpdates.size(); i1++)
            {
                var redstoneupdateinfo = (RedstoneUpdateInfo) torchUpdates.get(i1);
                if (redstoneupdateinfo.x == i && redstoneupdateinfo.y == j && redstoneupdateinfo.z == k && ++l >= 8)
                {
                    return true;
                }
            }

            return false;
        }
开发者ID:riverar,项目名称:Crafty,代码行数:18,代码来源:BlockRedstoneTorch.cs

示例2: storeChunkInCompound

        public static void storeChunkInCompound(Chunk chunk, World world, NBTTagCompound nbttagcompound)
        {
            world.checkSessionLock();
            nbttagcompound.setInteger("xPos", chunk.xPosition);
            nbttagcompound.setInteger("zPos", chunk.zPosition);
            nbttagcompound.setLong("LastUpdate", world.getWorldTime());
            nbttagcompound.setByteArray("Blocks", chunk.blocks);
            nbttagcompound.setByteArray("Data", chunk.data.data);
            nbttagcompound.setByteArray("SkyLight", chunk.skylightMap.data);
            nbttagcompound.setByteArray("BlockLight", chunk.blocklightMap.data);
            nbttagcompound.setByteArray("HeightMap", chunk.heightMap);
            nbttagcompound.setBoolean("TerrainPopulated", chunk.isTerrainPopulated);
            chunk.hasEntities = false;
            var nbttaglist = new NBTTagList();

            for (int i = 0; i < chunk.entities.Length; i++)
            {
                Iterator iterator = chunk.entities[i].iterator();
                do
                {
                    if (!iterator.hasNext())
                    {
                        goto label0;
                    }
                    var entity = (Entity) iterator.next();
                    chunk.hasEntities = true;
                    var nbttagcompound1 = new NBTTagCompound();
                    if (entity.addEntityID(nbttagcompound1))
                    {
                        nbttaglist.setTag(nbttagcompound1);
                    }
                } while (true);
            }
            label0:

            nbttagcompound.setTag("Entities", nbttaglist);
            var nbttaglist1 = new NBTTagList();
            NBTTagCompound nbttagcompound2;
            for (Iterator iterator1 = chunk.chunkTileEntityMap.values().iterator();
                 iterator1.hasNext();
                 nbttaglist1.setTag(nbttagcompound2))
            {
                var tileentity = (TileEntity) iterator1.next();
                nbttagcompound2 = new NBTTagCompound();
                tileentity.writeToNBT(nbttagcompound2);
            }

            nbttagcompound.setTag("TileEntities", nbttaglist1);
        }
开发者ID:riverar,项目名称:Crafty,代码行数:49,代码来源:ChunkLoader.cs

示例3: updateTick

 public override void updateTick(World world, int i, int j, int k, Random random)
 {
     bool flag = func_22016_g(world, i, j, k);
     for (;
         torchUpdates.size() > 0 &&
         world.getWorldTime() - ((RedstoneUpdateInfo) torchUpdates.get(0)).updateTime > 100L;
         torchUpdates.remove(0))
     {
     }
     if (torchActive)
     {
         if (flag)
         {
             world.setBlockAndMetadataWithNotify(i, j, k, torchRedstoneIdle.blockID,
                                                 world.getBlockMetadata(i, j, k));
             if (checkForBurnout(world, i, j, k, true))
             {
                 world.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F, "random.fizz", 0.5F,
                                       2.6F + (world.rand.nextFloat() - world.rand.nextFloat())*0.8F);
                 for (int l = 0; l < 5; l++)
                 {
                     double d = i + random.nextDouble()*0.59999999999999998D + 0.20000000000000001D;
                     double d1 = j + random.nextDouble()*0.59999999999999998D + 0.20000000000000001D;
                     double d2 = k + random.nextDouble()*0.59999999999999998D + 0.20000000000000001D;
                     world.spawnParticle("smoke", d, d1, d2, 0.0D, 0.0D, 0.0D);
                 }
             }
         }
     }
     else if (!flag && !checkForBurnout(world, i, j, k, false))
     {
         world.setBlockAndMetadataWithNotify(i, j, k, torchRedstoneActive.blockID,
                                             world.getBlockMetadata(i, j, k));
     }
 }
开发者ID:riverar,项目名称:Crafty,代码行数:35,代码来源:BlockRedstoneTorch.cs


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