Advertisement
Brord

Untitled

Oct 25th, 2018
506
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. class CmdWhatever extends FCommand {
  2. //Whatever
  3. }
  4.  
  5. public void addFactionsCommand(){
  6. FCmdRoot cmd = null;
  7.  
  8. P factions = (P) bukit.getPluginByName("factionsuuid")
  9. Class<?> factionsClass = p.getClass();
  10. Field[] fields = factionsClass.getFields();
  11. for (Field field : fields) {
  12. if (field.getName().equals("cmdBase")){
  13. field.setAccessible(true);
  14. cmd = (FCmdRoot) field.get(factions);
  15. break;
  16. }
  17. }
  18. if (cmd != null){
  19. cmd.addSubCommand(new CmdWhatever())
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement