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


Java World.setStorm方法代码示例

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


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

示例1: onWorldLoad

import org.bukkit.World; //导入方法依赖的package包/类
@EventHandler
public void onWorldLoad(WorldLoadEvent event) {
    World w = event.getWorld();
    if (w.hasStorm())
        w.setStorm(false);
    if (w.isThundering())
        w.setThundering(false);
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:9,代码来源:EnvironmentManager.java

示例2: loadWorlds

import org.bukkit.World; //导入方法依赖的package包/类
private void loadWorlds() {
    for (World w : getServer().getWorlds()) {
        EnvironmentManager.despawnEntities(w.getEntities().toArray(new Entity[w.getEntities().size()]));
        w.setThunderDuration(0);
        w.setWeatherDuration(0);
        w.setStorm(false);
        w.setThundering(false);
        if (!w.getName().equals(BOSS_WORLD))
            w.setTime(0);
    }
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:12,代码来源:SakiRPG.java

示例3: run

import org.bukkit.World; //导入方法依赖的package包/类
@Override
public void run (WCUser user, String lbl, String[] args) {
    World mundo = user.getPlayer().getWorld();
    int parametrosdelluvia = (300 + (new Random()).nextInt(600)) * 20;

    switch(args[0].toLowerCase()) {
        case "sun":
        case "sol":
        case "clear":
            //sol
            mundo.setWeatherDuration(0);
            mundo.setStorm(false);
            mundo.setThundering(false);
            mundo.setThunderDuration(0);
            break;
        case "rain":
        case "lluvia":
            //luvia
            mundo.setWeatherDuration(parametrosdelluvia);
            mundo.setStorm(true);
            mundo.setThundering(false);
            break;
        case "thunder":
        case "tormenta":
            //tormenta
            mundo.setWeatherDuration(parametrosdelluvia);
            mundo.setThunderDuration(parametrosdelluvia);
            mundo.setStorm(true);
            mundo.setThundering(true);
            break;
        default:
            break;
    }
    user.sendMessagePrefix("Tiempo &2" + args[0].toLowerCase());
}
 
开发者ID:cadox8,项目名称:WC,代码行数:36,代码来源:WeatherCMD.java

示例4: loadMap

import org.bukkit.World; //导入方法依赖的package包/类
public boolean loadMap(int gNumber) {
	WorldController wc = SkyWarsReloaded.getWC();
	String mapName = name + "_" + gNumber;
	boolean mapExists = false;
	File target = new File(rootDirectory, mapName);
	if(target.isDirectory()) {			 
		if(target.list().length > 0) {
 			mapExists = true;
		}	 
	}
	if (mapExists) {
		SkyWarsReloaded.getWC().deleteWorld(mapName);
	}
	
	wc.copyWorld(source, target);
	
	boolean loaded = SkyWarsReloaded.getWC().loadWorld(mapName);
	if (loaded) {
		World world = SkyWarsReloaded.get().getServer().getWorld(mapName);
	    world.setAutoSave(false);
	    world.setThundering(false);
	    world.setStorm(false);
	    world.setDifficulty(Difficulty.NORMAL);
	    world.setSpawnLocation(2000, 0, 2000);
	    world.setTicksPerAnimalSpawns(1);
	    world.setTicksPerMonsterSpawns(1);
        world.setGameRuleValue("doMobSpawning", "false");
        world.setGameRuleValue("mobGriefing", "false");
        world.setGameRuleValue("doFireTick", "false");
        world.setGameRuleValue("showDeathMessages", "false");
	}
	return loaded;
}
 
开发者ID:smessie,项目名称:SkyWarsReloaded,代码行数:34,代码来源:GameMap.java

示例5: setWeather

import org.bukkit.World; //导入方法依赖的package包/类
private void setWeather() {
	String weather = getWeather();
	final World world = SkyWarsReloaded.get().getServer().getWorld(mapName + "_" + gameNumber);
	if (weather.equalsIgnoreCase("sunny")) {
		world.setStorm(false);
		world.setWeatherDuration(Integer.MAX_VALUE);
	} else if (weather.equalsIgnoreCase("rain")) {
		world.setStorm(true);
		world.setWeatherDuration(Integer.MAX_VALUE);
	} else if (weather.equalsIgnoreCase("thunder storm")) {
		world.setStorm(true);
		world.setThundering(true);
		world.setThunderDuration(Integer.MAX_VALUE);
		world.setWeatherDuration(Integer.MAX_VALUE);
		thunderStorm = true;
	} else if (weather.equalsIgnoreCase("snow")) {
		for (int x = min; x < max; x++) {
			for (int z = min; z < max; z++) {
				world.setBiome(x, z, Biome.ICE_PLAINS);
			}
		}
		world.setStorm(true);
		world.setWeatherDuration(Integer.MAX_VALUE);
		List<Chunk> chunks = getChunks();
		SkyWarsReloaded.getNMS().updateChunks(mapWorld, chunks);
		world.setStorm(true);
		world.setWeatherDuration(Integer.MAX_VALUE);
	}
}
 
开发者ID:smessie,项目名称:SkyWarsReloaded,代码行数:30,代码来源:Game.java

示例6: skipNight

import org.bukkit.World; //导入方法依赖的package包/类
public static void skipNight() {
    if (getSleepCount() < getNeededPlayers())
        return; // We don't have enough players sleeping.

    World world = Core.getMainWorld();
    world.setTime(0);
    world.setStorm(false);
    Bukkit.broadcastMessage(ChatColor.GRAY + "" + ChatColor.ITALIC + " * The night has been vanquished by the wonders of sleep. *");
}
 
开发者ID:Kneesnap,项目名称:Kineticraft,代码行数:10,代码来源:SleepMechanics.java

示例7: prepareWorld

import org.bukkit.World; //导入方法依赖的package包/类
public void prepareWorld(World w) {
    w.setPVP(true);
    w.setGameRuleValue("doDaylightCycle", "false");
    w.setStorm(false);
    w.setDifficulty(Difficulty.PEACEFUL);
    w.setTime(14000);
    w.getLivingEntities().stream().filter(e -> !e.getType().equals(EntityType.PLAYER)).forEach(Entity::remove);
    initArena();
    w.setAutoSave(false);
}
 
开发者ID:cadox8,项目名称:PA,代码行数:11,代码来源:ArenaManager.java

示例8: run

import org.bukkit.World; //导入方法依赖的package包/类
@Override
public void run(PAUser user, String lbl, String[] args) {
    World mundo = user.getPlayer().getWorld();
    int parametrosdelluvia = (300 + (new Random()).nextInt(600)) * 20;

    switch (args[0].toLowerCase()) {
        case "sun":
        case "sol":
        case "clear":
            //sol
            mundo.setWeatherDuration(0);
            mundo.setStorm(false);
            mundo.setThundering(false);
            mundo.setThunderDuration(0);
            break;
        case "rain":
        case "lluvia":
            //luvia
            mundo.setWeatherDuration(parametrosdelluvia);
            mundo.setStorm(true);
            mundo.setThundering(false);
            break;
        case "thunder":
        case "tormenta":
            //tormenta
            mundo.setWeatherDuration(parametrosdelluvia);
            mundo.setThunderDuration(parametrosdelluvia);
            mundo.setStorm(true);
            mundo.setThundering(true);
            break;
        default:
            break;
    }
    user.sendMessage(PAData.CORE.getPrefix() + "Tiempo &2" + args[0].toLowerCase());
}
 
开发者ID:cadox8,项目名称:PA,代码行数:36,代码来源:WeatherCMD.java


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