Lucasdesigner

MinesEventHandler.java

Oct 16th, 2021
857
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.sf.l2j.gameserver.custom.usermenu.menuhandlers;
  2.  
  3. import net.sf.l2j.gameserver.custom.events.mines.MinesManager;
  4. import net.sf.l2j.gameserver.custom.events.mines.Mines;
  5. import net.sf.l2j.gameserver.model.actor.instance.Player;
  6.  
  7. import java.util.StringTokenizer;
  8.  
  9. public class MinesEventHandler {
  10.     public static MinesEventHandler getInstance()
  11.     {
  12.         return MinesEventHandler.SingletonHolder._instance;
  13.     }
  14.  
  15.     public void parseCmd(String command, Player activeChar)
  16.     {
  17.         StringTokenizer st = new StringTokenizer(command, " ");
  18.         if(activeChar.isGM())
  19.             activeChar.sendMessage("[CMD]: "+command);
  20.  
  21.         if(command.startsWith("_menuMinesSelect")){
  22.             String selected = "";
  23.             String cmdContent = st.nextToken();
  24.             int position = Integer.valueOf(st.nextToken());
  25.             int chance = Integer.valueOf(st.nextToken());
  26.             Mines newMine =  MinesManager.getInstance().getMine(activeChar.getObjectId());
  27.  
  28.             if(chance > 50)
  29.                 newMine.soloRewards(activeChar);
  30.  
  31.             newMine.selectedBox(position);
  32.             newMine.minesWindow(activeChar);
  33.         }else if(command.startsWith("_menuShowMines")){
  34.  
  35.         }
  36.     }
  37.  
  38.     private static class SingletonHolder
  39.     {
  40.         protected static final MinesEventHandler _instance = new MinesEventHandler();
  41.     }
  42. }
RAW Paste Data