本文整理汇总了Java中org.bukkit.World.setThunderDuration方法的典型用法代码示例。如果您正苦于以下问题:Java World.setThunderDuration方法的具体用法?Java World.setThunderDuration怎么用?Java World.setThunderDuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.World
的用法示例。
在下文中一共展示了World.setThunderDuration方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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());
}
示例3: 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);
}
}
示例4: 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());
}