Add region priority getter

This commit is contained in:
Gabriele C 2018-08-20 00:56:35 +02:00
parent 8487298362
commit c71a728254
3 changed files with 13 additions and 1 deletions

View File

@ -14,5 +14,7 @@ public abstract class AbstractRegion {
public abstract Object getFlag(String name); public abstract Object getFlag(String name);
public abstract Map<String, Object> getFlags(); public abstract Map<String, Object> getFlags();
public abstract int getPriority();
} }

View File

@ -66,11 +66,16 @@ public class WorldGuardImplementation extends AbstractWorldGuardImplementation {
region.getFlags().forEach((flag, value) -> map.put(flag.getName(), value)); region.getFlags().forEach((flag, value) -> map.put(flag.getName(), value));
return map; return map;
} }
@Override @Override
public Object getFlag(String name) { public Object getFlag(String name) {
return region.getFlag(flagRegistry.get(name)); return region.getFlag(flagRegistry.get(name));
} }
@Override
public int getPriority() {
return region.getPriority();
}
}; };
} }

View File

@ -81,6 +81,11 @@ public class WorldGuardImplementation extends AbstractWorldGuardImplementation {
public Object getFlag(String name) { public Object getFlag(String name) {
return region.getFlag(flagRegistry.get(name)); return region.getFlag(flagRegistry.get(name));
} }
@Override
public int getPriority() {
return region.getPriority();
}
}; };
} }