+ Fixed issue where blocked/whitelisted regions weren't set up (were commented out with "TODO" posted)
This commit is contained in:
Charles 2019-02-12 21:57:40 +08:00
parent fff79bb005
commit 866d437f05
2 changed files with 28 additions and 28 deletions

View File

@ -52,21 +52,21 @@ public class BossLocationManager implements IReloadable {
if(getBlockedWorlds().contains(location.getWorld().getName())) return false;
}
boolean isInBlockedRegion = false;
if(this.bossHookManager.isWorldguardEnabld() && this.bossHookManager.getWorldGuardHelper() != null) {
// TODO: Add Blocked regions support
// List<String> currentRegions = this.bossHookManager.getWorldGuardHelper().getRegionNames(location);
// boolean blocked = false;
//
// if(currentRegions != null) {
// for(String s : this.bossHookManager.getWorldguardBlockedRegions()) {
// if(currentRegions.contains(s)) {
// blocked = true;
// break;
// }
// }
//
// if(blocked) return false;
// }
List<String> currentRegions = this.bossHookManager.getWorldGuardHelper().getRegionNames(location);
if(currentRegions != null) {
for(String s : this.bossHookManager.getWorldguardBlockedRegions()) {
if(currentRegions.contains(s)) {
isInBlockedRegion = true;
break;
}
}
}
if(isInBlockedRegion) return false;
}
if(this.bossHookManager.isFactionsEnabled() && this.bossHookManager.getFactionHelper() != null) {
@ -74,19 +74,19 @@ public class BossLocationManager implements IReloadable {
}
if(this.bossHookManager.isWorldguardEnabld() && this.bossHookManager.getWorldGuardHelper() != null) {
// List<String> currentRegions = this.bossHookManager.getWorldGuardHelper().getRegionNames(location);
// boolean allowed = false;
//
// if(currentRegions != null) {
// for(String s : this.bossHookManager.getWorldGuardSpawnRegions()) {
// if(currentRegions.contains(s)) {
// allowed = true;
// break;
// }
// }
//
// if(!allowed) return false;
// }
List<String> currentRegions = this.bossHookManager.getWorldGuardHelper().getRegionNames(location);
boolean allowed = false;
if(currentRegions != null) {
for(String s : this.bossHookManager.getWorldGuardSpawnRegions()) {
if(currentRegions.contains(s)) {
allowed = true;
break;
}
}
if(!allowed) return false;
}
}
if(this.bossHookManager.isAskyblockEnabled() && this.bossHookManager.getASkyblockHelper() != null) {

View File

@ -19,7 +19,7 @@
</modules>
<properties>
<plugin.version>1.0.7-U3</plugin.version>
<plugin.version>1.0.8-U1</plugin.version>
<plugin.name>EpicBosses</plugin.name>
<plugin.main>com.songoda.epicbosses.CustomBosses</plugin.main>
<plugin.author>AMinecraftDev</plugin.author>