diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index 57e4603c7..b81e2ae90 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -6,12 +6,12 @@ import java.time.LocalDate; import java.time.YearMonth; import java.time.format.TextStyle; import java.util.ArrayList; -import java.util.Calendar; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.UUID; +import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -22,6 +22,7 @@ import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.weather.WeatherChangeEvent; import org.bukkit.plugin.java.JavaPlugin; import mineplex.core.Managers; @@ -54,6 +55,8 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable private NautHashMap> _agentCacheMap = new NautHashMap>(); private NautHashMap> _accountBonusLog = new NautHashMap<>(); + + private boolean _allowWeatherChange = false; public CustomerSupport(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, SalesPackageManager salesPackageManager, PowerPlayClubRepository powerPlayRepo) { @@ -64,6 +67,10 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable _salesPackageManager = salesPackageManager; _repository = new CustomerSupportRepository(getPlugin()); _powerPlayRepo = powerPlayRepo; + + _allowWeatherChange = true; + Bukkit.getWorlds().get(0).setStorm(false); + _allowWeatherChange = false; } @EventHandler @@ -402,6 +409,15 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable event.setCancelled(true); } + + @EventHandler + public void stopRain(WeatherChangeEvent event) + { + if (!_allowWeatherChange) + { + event.setCancelled(true); + } + } @Override public void processResultSet(ResultSet resultSet) throws SQLException