Skip to content

Commit 635443f

Browse files
Potential fix for #1006 Don't set __global__ region flags
And set `TARDIS_junk` region to entry:allow, exit:deny
1 parent a45d048 commit 635443f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/main/java/me/eccentric_nz/TARDIS/utility/protection/TARDISWorldGuardUtils.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public void addRendererProtection(String name, Location one, Location two) {
314314
try {
315315
rm.save();
316316
} catch (StorageException e) {
317-
plugin.getMessenger().message(plugin.getConsole(), TardisModule.TARDIS, "Could not create WorldGuard Protection for exterior renderering room! " + e.getMessage());
317+
plugin.getMessenger().message(plugin.getConsole(), TardisModule.TARDIS, "Could not create WorldGuard Protection for exterior rendering room! " + e.getMessage());
318318
}
319319
}
320320

@@ -339,7 +339,7 @@ public void addPlotWorldProtection(World world) {
339339
}
340340

341341
/**
342-
* Adds a WorldGuard protected region to exterior renderer room.
342+
* Adds a WorldGuard protected region to a claimed plot.
343343
*
344344
* @param uuid the name of the player growing the render room
345345
* @param one a start location of a cuboid region
@@ -807,9 +807,18 @@ public void checkEntryFlags() {
807807
State flag = plugin.getConfig().getBoolean("preferences.open_door_policy") ? State.ALLOW : State.DENY;
808808
RegionManager rm = wg.getRegionContainer().get(new BukkitWorld(world));
809809
for (ProtectedRegion region : rm.getRegions().values()) {
810+
// don't change the global region
811+
if (region.getId().equals("__global__")) {
812+
continue;
813+
}
810814
Map<Flag<?>, Object> flags = region.getFlags();
811-
flags.put(Flags.ENTRY, flag);
812-
flags.put(Flags.EXIT, flag);
815+
if (region.getId().equals("TARDIS_junk")) {
816+
flags.put(Flags.ENTRY, State.ALLOW);
817+
flags.put(Flags.EXIT, State.DENY);
818+
} else {
819+
flags.put(Flags.ENTRY, flag);
820+
flags.put(Flags.EXIT, flag);
821+
}
813822
region.setFlags(flags);
814823
}
815824
try {

0 commit comments

Comments
 (0)