setFlags(flagRegistry, region, node.getNode("flags")); region.setOwners(parseDomain(node.getNode("owners"))); region.setMembers(parseDomain(node.getNode("members")));
/** * Copy attributes from another region. * * @param other the other region */ public void copyFrom(ProtectedRegion other) { checkNotNull(other); setMembers(other.getMembers()); setOwners(other.getOwners()); setFlags(other.getFlags()); setPriority(other.getPriority()); try { setParent(other.getParent()); } catch (CircularInheritanceException ignore) { // This should not be thrown } }
void setUpFountainRegion() throws Exception { DefaultDomain domain = new DefaultDomain(); domain.addGroup(MEMBER_GROUP); ProtectedRegion region = new ProtectedCuboidRegion(FOUNTAIN_ID, BlockVector3.ZERO, BlockVector3.at(5, 5, 5)); region.setMembers(domain); manager.addRegion(region); fountain = region; fountain.setParent(courtyard); fountain.setFlag(Flags.FIRE_SPREAD, StateFlag.State.DENY); }
void setUpFountainRegion() throws Exception { DefaultDomain domain = new DefaultDomain(); domain.addGroup(MEMBER_GROUP); ProtectedRegion region = new ProtectedCuboidRegion(FOUNTAIN_ID, BlockVector3.ZERO, BlockVector3.at(5, 5, 5)); region.setMembers(domain); manager.addRegion(region); fountain = region; fountain.setParent(courtyard); fountain.setFlag(Flags.FIRE_SPREAD, StateFlag.State.DENY); fountain.setFlag(Flags.MOB_SPAWNING, StateFlag.State.ALLOW); }
void setUpEntryRegion() { DefaultDomain domain = new DefaultDomain(); domain.addGroup(VIP_GROUP); ProtectedRegion region = new ProtectedCuboidRegion(ENTRY_ID, BlockVector3.at(1, 0, 1), BlockVector3.at(10, 255, 10)); region.setMembers(domain); manager.addRegion(region); entryRegion = region; // this is the way it's supposed to work // whatever the group flag is set to is the group that the flag APPLIES to // in this case, non members (esskay) should be DENIED entry entryRegion.setFlag(Flags.ENTRY, StateFlag.State.DENY); entryRegion.setFlag(Flags.ENTRY.getRegionGroupFlag(), RegionGroup.NON_MEMBERS); }