Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //Add custom flag (WorldGuard)
- //
- private void tryToAddCustomFlag(){
- if(getServer().getPluginManager().getPlugin("WorldGuard") == null) {
- return;
- }
- if(getConfig().getBoolean("config.custom flag")) {
- try {
- try {
- FlagRegistry registry = WorldGuard.getInstance().getFlagRegistry();
- // create a flag with a name and a default value
- StateFlag flag = new StateFlag("open-player-info", true);
- registry.register(flag);
- // Set field if there were no errors
- PLAYER_INFO_OPEN_FLAG = flag;
- customFlagAdded = true;
- }catch (FlagConflictException e) {
- customFlagAdded = false;
- }
- }catch (NoClassDefFoundError error) {
- customFlagAdded = false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement