Skip to content

Commit

Permalink
2日経たないと制限が増えない問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Taitaitatata committed Nov 17, 2024
1 parent 4dda11a commit e7e2360
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/net/nekozouneko/playerguard/PlayerGuard.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.nekozouneko.playerguard.selection.SelectionStorage;
import net.nekozouneko.playerguard.task.ActionbarTask;
import net.nekozouneko.playerguard.task.SelectionRenderTask;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.Statistic;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -91,7 +92,7 @@ public void onDisable() {

public long getProtectLimit(Player player) {
int days = (player.getStatistic(Statistic.PLAY_ONE_MINUTE) / 20) / 60 / 60 / 24;
long limit = (long) (PROTECTION_LIMIT_BASE_VALUE * Math.cbrt(Math.min(Math.max(1, days), 10)));
long limit = (long) (PROTECTION_LIMIT_BASE_VALUE * Math.cbrt(Math.min(Math.max(1, days+1), 10)));

NamespacedKey key = new NamespacedKey(this, "limit-extends");
Long extend = player.getPersistentDataContainer().get(key, PersistentDataType.LONG);
Expand Down

0 comments on commit e7e2360

Please sign in to comment.