Skip to content

Commit

Permalink
[Fixed] Incorrect cooldown time displayed on console for rewards.
Browse files Browse the repository at this point in the history
[Fixed] PlotSquared World not found issue.
  • Loading branch information
TeamHRLive committed Apr 21, 2024
1 parent 863ba3d commit 278cac7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public final class PlotSquaredOwnCheck extends TerritoryCheck {
@Override public boolean check(Player p) {
org.bukkit.Location l = p.getLocation();
Plot plot = Location.at(l.getWorld().toString(), l.getBlockX(), l.getBlockY(), l.getBlockZ()).getPlot();
Plot plot = Location.at(l.getWorld().getName(), l.getBlockX(), l.getBlockY(), l.getBlockZ()).getPlot();

return plot != null && plot.hasOwner() && plot.getOwners().contains(p.getUniqueId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public final class PlotSquaredTrustedCheck extends TerritoryCheck {
@Override public boolean check(Player p) {
org.bukkit.Location l = p.getLocation();
Plot plot = Location.at(l.getWorld().toString(), l.getBlockX(), l.getBlockY(), l.getBlockZ()).getPlot();
Plot plot = Location.at(l.getWorld().getName(), l.getBlockX(), l.getBlockY(), l.getBlockZ()).getPlot();

return plot != null && plot.getTrusted().contains(p.getUniqueId());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ public void loadRewards() {

String cooldownStr = conf.getConfigurationSection(categoryName).getString("cooldown");
cooldown = MathUtil.calculateDuration(cooldownStr) * 20; // Convert to ticks

commands = conf.getConfigurationSection(categoryName).getStringList("commands");

if (category != null) {
rewardTasks.add(new Reward(category, commands).runTaskTimer(pl, 0, cooldown));
loaded(categoryName, commands, PlayerUtil.durationToWords(cooldown * 50)); // Convert from ticks to ms
loaded(categoryName, commands, PlayerUtil.durationToWords(cooldown / 20));
} else {
nonexistent(categoryName);
}
Expand Down

0 comments on commit 278cac7

Please sign in to comment.