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


Java World.getWorldInfo方法代码示例

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


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

示例1: processCommand

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * Callback when the command is invoked
 */
public void processCommand(ICommandSender sender, String[] args) throws CommandException
{
    if (args.length >= 1 && args.length <= 2)
    {
        int i = (300 + (new Random()).nextInt(600)) * 20;

        if (args.length >= 2)
        {
            i = parseInt(args[1], 1, 1000000) * 20;
        }

        World world = MinecraftServer.getServer().worldServers[0];
        WorldInfo worldinfo = world.getWorldInfo();

        if ("clear".equalsIgnoreCase(args[0]))
        {
            worldinfo.setCleanWeatherTime(i);
            worldinfo.setRainTime(0);
            worldinfo.setThunderTime(0);
            worldinfo.setRaining(false);
            worldinfo.setThundering(false);
            notifyOperators(sender, this, "commands.weather.clear", new Object[0]);
        }
        else if ("rain".equalsIgnoreCase(args[0]))
        {
            worldinfo.setCleanWeatherTime(0);
            worldinfo.setRainTime(i);
            worldinfo.setThunderTime(i);
            worldinfo.setRaining(true);
            worldinfo.setThundering(false);
            notifyOperators(sender, this, "commands.weather.rain", new Object[0]);
        }
        else
        {
            if (!"thunder".equalsIgnoreCase(args[0]))
            {
                throw new WrongUsageException("commands.weather.usage", new Object[0]);
            }

            worldinfo.setCleanWeatherTime(0);
            worldinfo.setRainTime(i);
            worldinfo.setThunderTime(i);
            worldinfo.setRaining(true);
            worldinfo.setThundering(true);
            notifyOperators(sender, this, "commands.weather.thunder", new Object[0]);
        }
    }
    else
    {
        throw new WrongUsageException("commands.weather.usage", new Object[0]);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:56,代码来源:CommandWeather.java

示例2: execute

import net.minecraft.world.World; //导入方法依赖的package包/类
/**
 * Callback for when the command is executed
 */
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
    if (args.length >= 1 && args.length <= 2)
    {
        int i = (300 + (new Random()).nextInt(600)) * 20;

        if (args.length >= 2)
        {
            i = parseInt(args[1], 1, 1000000) * 20;
        }

        World world = server.worldServers[0];
        WorldInfo worldinfo = world.getWorldInfo();

        if ("clear".equalsIgnoreCase(args[0]))
        {
            worldinfo.setCleanWeatherTime(i);
            worldinfo.setRainTime(0);
            worldinfo.setThunderTime(0);
            worldinfo.setRaining(false);
            worldinfo.setThundering(false);
            notifyCommandListener(sender, this, "commands.weather.clear", new Object[0]);
        }
        else if ("rain".equalsIgnoreCase(args[0]))
        {
            worldinfo.setCleanWeatherTime(0);
            worldinfo.setRainTime(i);
            worldinfo.setThunderTime(i);
            worldinfo.setRaining(true);
            worldinfo.setThundering(false);
            notifyCommandListener(sender, this, "commands.weather.rain", new Object[0]);
        }
        else
        {
            if (!"thunder".equalsIgnoreCase(args[0]))
            {
                throw new WrongUsageException("commands.weather.usage", new Object[0]);
            }

            worldinfo.setCleanWeatherTime(0);
            worldinfo.setRainTime(i);
            worldinfo.setThunderTime(i);
            worldinfo.setRaining(true);
            worldinfo.setThundering(true);
            notifyCommandListener(sender, this, "commands.weather.thunder", new Object[0]);
        }
    }
    else
    {
        throw new WrongUsageException("commands.weather.usage", new Object[0]);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:56,代码来源:CommandWeather.java

示例3: getBiomeProvider

import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public BiomeProvider getBiomeProvider(World world)
   {
	return new BiomeProviderExP(world.getWorldInfo());
   }
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:6,代码来源:WorldTypeExP.java

示例4: getWorldInfo

import net.minecraft.world.World; //导入方法依赖的package包/类
public static WorldInfo getWorldInfo(World world) { return world.getWorldInfo(); } 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:2,代码来源:ZWrapper.java


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