Skip to content

Commit

Permalink
Update RTP_HuskTowns.java (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
matipoirierg authored Jun 10, 2024
1 parent c721cd7 commit 9c21792
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 9c21792

Please sign in to comment.