- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.bukkit.event.weather.WeatherChangeEvent.getWorld()
方法的一些代码示例,展示了WeatherChangeEvent.getWorld()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WeatherChangeEvent.getWorld()
方法的具体详情如下:
包路径:org.bukkit.event.weather.WeatherChangeEvent
类名称:WeatherChangeEvent
方法名:getWorld
暂无
代码示例来源:origin: TotalFreedom/TotalFreedomMod
@EventHandler(priority = EventPriority.HIGH)
public void onWeatherChange(WeatherChangeEvent event)
{
try
{
if (event.getWorld().equals(adminworld.getWorld()) && adminworld.getWeatherMode() != WorldWeather.OFF)
{
return;
}
}
catch (Exception ex)
{
}
if (ConfigEntry.DISABLE_WEATHER.getBoolean() && event.toWeatherState())
{
event.setCancelled(true);
}
}
代码示例来源:origin: io.github.bedwarsrel/BedwarsRel-Common
@EventHandler
public void onWeatherEvent(WeatherChangeEvent we) {
if (we.isCancelled()) {
return;
}
List<Game> games = BedwarsRel.getInstance().getGameManager().getGamesByWorld(we.getWorld());
if (games.size() == 0) {
return;
}
for (Game game : games) {
if (game.getState() != GameState.STOPPED) {
we.setCancelled(true);
break;
}
}
}
代码示例来源:origin: BedwarsRel/BedwarsRel
@EventHandler
public void onWeatherEvent(WeatherChangeEvent we) {
if (we.isCancelled()) {
return;
}
List<Game> games = BedwarsRel.getInstance().getGameManager().getGamesByWorld(we.getWorld());
if (games.size() == 0) {
return;
}
for (Game game : games) {
if (game.getState() != GameState.STOPPED) {
we.setCancelled(true);
break;
}
}
}
代码示例来源:origin: Multiverse/Multiverse-Core
/**
* This method is called when the weather changes.
* @param event The Event that was fired.
*/
@EventHandler
public void weatherChange(WeatherChangeEvent event) {
if (event.isCancelled()) {
return;
}
MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getWorld().getName());
if (world != null) {
// If it's going to start raining and we have weather disabled
event.setCancelled((event.toWeatherState() && !world.isWeatherEnabled()));
}
}
代码示例来源:origin: EngineHub/WorldGuard
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onWeatherChange(WeatherChangeEvent event) {
ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
WorldConfiguration wcfg = cfg.get(BukkitAdapter.adapt(event.getWorld()));
if (event.toWeatherState()) {
if (wcfg.disableWeather) {
event.setCancelled(true);
}
} else {
if (!wcfg.disableWeather && wcfg.alwaysRaining) {
event.setCancelled(true);
}
}
}
代码示例来源:origin: DRE2N/DungeonsXL
@EventHandler
public void onWeatherChange(WeatherChangeEvent event) {
DInstanceWorld dWorld = dWorlds.getInstanceByWorld(event.getWorld());
if (dWorld instanceof DEditWorld && event.toWeatherState()) {
event.setCancelled(true);
} else if (dWorld instanceof DGameWorld) {
Game game = Game.getByGameWorld((DGameWorld) dWorld);
Boolean raining = game.getRules().isRaining();
if (raining == null) {
return;
}
if ((raining && !event.toWeatherState()) || (!raining && event.toWeatherState())) {
event.setCancelled(true);
}
}
}
本文整理了Java中org.bukkit.event.weather.WeatherChangeEvent.getWorld()方法的一些代码示例,展示了WeatherChangeEvent.getW
本文整理了Java中org.bukkit.event.world.WorldInitEvent.getWorld()方法的一些代码示例,展示了WorldInitEvent.getWorld()的具体用
我尝试使用方法getWorld来获取字符串的世界,但每次,无论我输入什么字符串,都会返回null。这是我尝试过的示例: World world = server.getWorld("world");
我是一名优秀的程序员,十分优秀!