Remove worldguard region integration

This commit is contained in:
Shevchik 2014-12-18 10:47:59 +04:00
parent 07d0e3d4a6
commit 94825e44a8
6 changed files with 355 additions and 394 deletions

Binary file not shown.

Binary file not shown.

View File

@ -19,7 +19,6 @@ import org.bukkit.material.WoodenStep;
import com.cnaude.chairs.commands.ChairsIgnoreList;
import com.cnaude.chairs.core.ChairBlock;
import com.cnaude.chairs.core.Chairs;
import com.cnaude.chairs.pluginhooks.WGHook;
public class TrySitEventListener implements Listener {
@ -77,11 +76,6 @@ public class TrySitEventListener implements Listener {
return false;
}
// Region allowance check
if (!WGHook.isAllowedInRegion(plugin.disabledRegions, block.getLocation())) {
return false;
}
Stairs stairs = null;
Step step = null;
WoodenStep wStep = null;

View File

@ -1,31 +0,0 @@
package com.cnaude.chairs.pluginhooks;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import com.sk89q.worldedit.bukkit.BukkitUtil;
import com.sk89q.worldguard.bukkit.WGBukkit;
public class WGHook {
public static boolean isAllowedInRegion(HashSet<String> disabledRegions, Location location) {
if (Bukkit.getPluginManager().getPlugin("WorldGuard") == null) {
return true;
}
if (disabledRegions.isEmpty()) {
return true;
}
List<String> aregions = WGBukkit.getRegionManager(location.getWorld()).getApplicableRegionsIDs(BukkitUtil.toVector(location));
for (String region : aregions) {
if (disabledRegions.contains(region)) {
return false;
}
}
return true;
}
}

View File

@ -35,8 +35,6 @@ max-chair-width: 3
sign-check: false
distance: 2
ignore-if-item-in-hand: false
disabledWGRegions:
- exampleregionname
sit-effects:
healing:
enabled: false

View File

@ -1,5 +1,5 @@
name: Chairs
version: 4.3
version: 4.4
description: Let players sit on blocks.
website: http://dev.bukkit.org/bukkit-plugins/chairsreloaded/
authors: