Update RTP_HuskTowns.java (#218)

This commit is contained in:
Matías Poirier 2024-06-10 10:39:11 -04:00 committed by GitHub
parent c721cd7837
commit 9c21792669
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,21 +1,27 @@
package me.SuperRonanCraft.BetterRTP.references.depends.regionPlugins;
import net.william278.husktowns.api.HuskTownsAPI;
import net.william278.husktowns.api.BukkitHuskTownsAPI;
import org.bukkit.Location;
import org.bukkit.plugin.java.JavaPlugin;
public class RTP_HuskTowns implements RegionPluginCheck {
// NOT TESTED (3.4.5)
// HuskTowns (v1.8.1)
// https://www.spigotmc.org/resources/husktowns.92672/
private final BukkitHuskTownsAPI huskTownsAPI;
public RTP_HuskTowns(JavaPlugin plugin) {
this.huskTownsAPI = BukkitHuskTownsAPI.getInstance();
}
@Override
public boolean check(Location loc) {
boolean result = true;
if (REGIONPLUGINS.HUSKTOWNS.isEnabled())
if (REGIONPLUGINS.HUSKTOWNS.isEnabled()) {
try {
result = !HuskTownsAPI.getInstance().getClaimAt(loc).isPresent();
result = !huskTownsAPI.getClaimAt(loc).isPresent();
} catch (Exception e) {
e.printStackTrace();
}
}
return result;
}
}