Optional disabling of WG checks
This commit is contained in:
parent
8be43164d2
commit
445d10afb7
@ -63,6 +63,8 @@ public class Conf {
|
|||||||
|
|
||||||
public static double autoLeaveAfterDaysOfInactivity = 14.0;
|
public static double autoLeaveAfterDaysOfInactivity = 14.0;
|
||||||
|
|
||||||
|
public static boolean worldGuardChecking = true;
|
||||||
|
|
||||||
public static boolean homesEnabled = true;
|
public static boolean homesEnabled = true;
|
||||||
public static boolean homesMustBeInClaimedTerritory = true;
|
public static boolean homesMustBeInClaimedTerritory = true;
|
||||||
public static boolean homesTeleportToOnDeath = true;
|
public static boolean homesTeleportToOnDeath = true;
|
||||||
|
@ -151,6 +151,10 @@ public class Factions extends JavaPlugin {
|
|||||||
Econ.setup(this);
|
Econ.setup(this);
|
||||||
Econ.monitorPlugins();
|
Econ.monitorPlugins();
|
||||||
|
|
||||||
|
if(Conf.worldGuardChecking) {
|
||||||
|
Worldguard.init(this);
|
||||||
|
}
|
||||||
|
|
||||||
// Register events
|
// Register events
|
||||||
PluginManager pm = this.getServer().getPluginManager();
|
PluginManager pm = this.getServer().getPluginManager();
|
||||||
pm.registerEvent(Event.Type.PLAYER_CHAT, this.playerListener, Event.Priority.Highest, this);
|
pm.registerEvent(Event.Type.PLAYER_CHAT, this.playerListener, Event.Priority.Highest, this);
|
||||||
|
@ -70,6 +70,7 @@ public class Worldguard {
|
|||||||
// True: Regions found within chunk
|
// True: Regions found within chunk
|
||||||
// False: No regions found within chunk
|
// False: No regions found within chunk
|
||||||
public static boolean checkForRegionsInChunk(Location loc) {
|
public static boolean checkForRegionsInChunk(Location loc) {
|
||||||
|
if(isEnabled()) {
|
||||||
int plocX = loc.getBlockX();
|
int plocX = loc.getBlockX();
|
||||||
int plocZ = loc.getBlockZ();
|
int plocZ = loc.getBlockZ();
|
||||||
World world = loc.getWorld();
|
World world = loc.getWorld();
|
||||||
@ -105,5 +106,8 @@ public class Worldguard {
|
|||||||
overlaps = null;
|
overlaps = null;
|
||||||
|
|
||||||
return foundregions;
|
return foundregions;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user