diff --git a/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil$1.class b/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil$1.class index dbc5d0b..36c6c50 100644 Binary files a/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil$1.class and b/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil$1.class differ diff --git a/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil.class b/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil.class index e40eeb4..7e6472e 100644 Binary files a/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil.class and b/out/production/ActionHealth/com/zeshanaslam/actionhealth/HealthUtil.class differ diff --git a/out/production/ActionHealth/com/zeshanaslam/actionhealth/TargetHelper.class b/out/production/ActionHealth/com/zeshanaslam/actionhealth/TargetHelper.class index a81660c..c4c1fcb 100644 Binary files a/out/production/ActionHealth/com/zeshanaslam/actionhealth/TargetHelper.class and b/out/production/ActionHealth/com/zeshanaslam/actionhealth/TargetHelper.class differ diff --git a/plugin.yml b/plugin.yml index 4c926a0..499f643 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ name: ActionHealth main: com.zeshanaslam.actionhealth.Main -version: 3.2.6 -softdepend: [PlaceholderAPI, MVdWPlaceholderAPI] +version: 3.2.7 +softdepend: [PlaceholderAPI, MVdWPlaceholderAPI, WorldGuard] commands: Actionhealth: description: Actionhealth main command. \ No newline at end of file diff --git a/src/com/zeshanaslam/actionhealth/HealthUtil.java b/src/com/zeshanaslam/actionhealth/HealthUtil.java index eeea064..3fa0604 100644 --- a/src/com/zeshanaslam/actionhealth/HealthUtil.java +++ b/src/com/zeshanaslam/actionhealth/HealthUtil.java @@ -1,7 +1,10 @@ package com.zeshanaslam.actionhealth; +import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldguard.protection.ApplicableRegionSet; import com.sk89q.worldguard.protection.regions.ProtectedRegion; +import com.sk89q.worldguard.protection.regions.RegionContainer; +import com.sk89q.worldguard.protection.regions.RegionQuery; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; @@ -223,8 +226,11 @@ public class HealthUtil { return false; } - ApplicableRegionSet applicableRegions = plugin.worldGuardPlugin.getRegionManager(location.getWorld()).getApplicableRegions(location); + RegionContainer regionContainer = com.sk89q.worldguard.WorldGuard.getInstance().getPlatform().getRegionContainer(); + RegionQuery regionQuery = regionContainer.createQuery(); + ApplicableRegionSet applicableRegions = regionQuery.getApplicableRegions(BukkitAdapter.adapt(location)); for (ProtectedRegion region : applicableRegions) { + System.out.println(region.getId()); if (plugin.settingsManager.regions.contains(region.getId())) { return true; } diff --git a/src/com/zeshanaslam/actionhealth/TargetHelper.java b/src/com/zeshanaslam/actionhealth/TargetHelper.java index bff06e9..81ce755 100644 --- a/src/com/zeshanaslam/actionhealth/TargetHelper.java +++ b/src/com/zeshanaslam/actionhealth/TargetHelper.java @@ -236,7 +236,7 @@ public class TargetHelper { Location temp = loc1.clone(); for (int i = 0; i < steps; i++) { temp.add(slope); - if (temp.getBlock().getType().isSolid() && temp.getBlock().getType() != Material.IRON_FENCE && !temp.getBlock().getType().toString().contains("GLASS")) { + if (temp.getBlock().getType().isSolid() && temp.getBlock().getType() != Material.LEGACY_IRON_FENCE && !temp.getBlock().getType().toString().contains("GLASS")) { return true; } } @@ -304,7 +304,7 @@ public class TargetHelper { BlockIterator itr = new BlockIterator(from, 0, distance); while (itr.hasNext()) { Block block = itr.next(); - int id = block.getTypeId(); + int id = block.getType().getId(); if (transparentTypeIds == null) { if (id == 0) continue; } else if (transparentTypeIds.contains((byte) id)) {