Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update HuskTowns hook to new api. #378

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FlightControl/build.gradle
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ dependencies {
compileOnly ('com.github.TechFortress:GriefPrevention:17.0.0') { exclude(group: "*") } // https://github.com/TechFortress/GriefPrevention/
compileOnly ('com.griefdefender:api:2.1.0-SNAPSHOT') { exclude(group: "*") } // https://github.com/bloodmc/GriefDefenderAPI
compileOnly ('world.bentobox:bentobox:2.0.0-SNAPSHOT') { exclude(group: "*") } // https://github.com/bentoboxworld
compileOnly ('net.william278:HuskTowns:2.6.1') { exclude(group: "*") } // https://github.com/WiIIiam278/HuskTowns
compileOnly ('net.william278.husktowns:husktowns-bukkit:3.0') { exclude(group: "*") } // https://github.com/WiIIiam278/HuskTowns
compileOnly ("io.github.fabiozumbi12.RedProtect:RedProtect-Core:8.1.1") { exclude(group: "*") }
compileOnly ("io.github.fabiozumbi12.RedProtect:RedProtect-Spigot:8.1.1") { exclude(group: "*") }
compileOnly ('com.bgsoftware:SuperiorSkyblockAPI:2023.3') { exclude(group: "*") }
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

package org.spazzinq.flightcontrol.check.territory.own;

import net.william278.husktowns.api.HuskTownsAPI;
import net.william278.husktowns.api.BukkitHuskTownsAPI;
import net.william278.husktowns.claim.TownClaim;
import net.william278.husktowns.town.Member;
import org.bukkit.entity.Player;
@@ -14,7 +14,8 @@
import java.util.Optional;

public class HuskTownsOwnCheck extends TerritoryCheck {
@Override public boolean check(Player p) {
@Override
public boolean check(Player p) {
Optional<TownClaim> townClaim = getTownClaim(p);
Optional<Member> member = getMember(p);

@@ -23,10 +24,10 @@ public class HuskTownsOwnCheck extends TerritoryCheck {
}

private Optional<TownClaim> getTownClaim(Player p) {
return HuskTownsAPI.getInstance().getClaimAt(p.getLocation());
return BukkitHuskTownsAPI.getInstance().getClaimAt(p.getLocation());
}

private Optional<Member> getMember(Player p) {
return HuskTownsAPI.getInstance().getUserTown(p);
return BukkitHuskTownsAPI.getInstance().getUserTown(p);
}
}
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

package org.spazzinq.flightcontrol.check.territory.trusted;

import net.william278.husktowns.api.HuskTownsAPI;
import net.william278.husktowns.api.BukkitHuskTownsAPI;
import net.william278.husktowns.claim.TownClaim;
import net.william278.husktowns.town.Member;
import net.william278.husktowns.town.Town;
@@ -15,7 +15,8 @@
import java.util.Optional;

public class HuskTownsTrustedCheck extends TerritoryCheck {
@Override public boolean check(Player p) {
@Override
public boolean check(Player p) {
Optional<TownClaim> townClaim = getTownClaim(p);
Optional<Member> member = getMember(p);

@@ -24,10 +25,10 @@ public class HuskTownsTrustedCheck extends TerritoryCheck {
}

private Optional<TownClaim> getTownClaim(Player p) {
return HuskTownsAPI.getInstance().getClaimAt(p.getLocation());
return BukkitHuskTownsAPI.getInstance().getClaimAt(p.getLocation());
}

private Optional<Member> getMember(Player p) {
return HuskTownsAPI.getInstance().getUserTown(p);
return BukkitHuskTownsAPI.getInstance().getUserTown(p);
}
}