Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CmdWhatever extends FCommand {
- //Whatever
- }
- public void addFactionsCommand(){
- FCmdRoot cmd = null;
- P factions = (P) bukit.getPluginByName("factionsuuid")
- Class<?> factionsClass = p.getClass();
- Field[] fields = factionsClass.getFields();
- for (Field field : fields) {
- if (field.getName().equals("cmdBase")){
- field.setAccessible(true);
- cmd = (FCmdRoot) field.get(factions);
- break;
- }
- }
- if (cmd != null){
- cmd.addSubCommand(new CmdWhatever())
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement