Advertisement
Guest User

AdminReloadDrops.java

a guest
Sep 29th, 2024
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. package handler.admincommands;
  2.  
  3. import events.XmlDropEvent;
  4. import l2.gameserver.model.Player;
  5.  
  6. /**
  7. * @author Trance
  8. */
  9. public class AdminReloadDrops extends ScriptAdminCommand
  10. {
  11. private enum Commands
  12. {
  13. admin_reload_drops
  14. }
  15.  
  16. @Override
  17. public boolean useAdminCommand(Enum comm, String[] wordList, String fullString, Player player)
  18. {
  19. final Commands command = (Commands) comm;
  20.  
  21. if (!player.getPlayerAccess().CanEditChar)
  22. return false;
  23.  
  24. if (command == Commands.admin_reload_drops)
  25. {
  26. XmlDropEvent.loadDrops(); // Reload the XML drop configuration
  27. if (XmlDropEvent.isEventEnabled())
  28. player.sendMessage("Drop configuration reloaded successfully.");
  29. else
  30. player.sendMessage("XML Drop Event is disabled in the configuration.");
  31. }
  32.  
  33. return true;
  34. }
  35.  
  36. @Override
  37. public Enum<?>[] getAdminCommandEnum()
  38. {
  39. return Commands.values();
  40. }
  41. }
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement