mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Cancel annoying weather in edit worlds
This commit is contained in:
parent
b3003ac3ed
commit
e74b1bbb2e
@ -16,10 +16,13 @@
|
||||
*/
|
||||
package io.github.dre2n.dungeonsxl.listener;
|
||||
|
||||
import io.github.dre2n.dungeonsxl.world.EditWorld;
|
||||
import io.github.dre2n.dungeonsxl.world.GameWorld;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.weather.WeatherChangeEvent;
|
||||
import org.bukkit.event.world.ChunkUnloadEvent;
|
||||
|
||||
/**
|
||||
@ -37,4 +40,17 @@ public class WorldListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onWeatherChange(WeatherChangeEvent event) {
|
||||
World world = event.getWorld();
|
||||
if (EditWorld.getByWorld(event.getWorld()) != null) {
|
||||
world.setStorm(false);
|
||||
world.setThundering(false);
|
||||
|
||||
if (event.toWeatherState()) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user