set compasstimer to 15 sec

This commit is contained in:
Martin Olischläger 2023-04-29 21:26:50 +02:00
parent b5f6ac467b
commit 6b9cc4ffc0
2 changed files with 2 additions and 3 deletions

View File

@ -26,10 +26,9 @@ public class ItemUseListener implements Consumer<PlayerUseItemEvent> {
CompassManager compassManager = CompassManager.getInstance(); CompassManager compassManager = CompassManager.getInstance();
if (!p.isAllowCompassUsage()) { if (!p.isAllowCompassUsage()) {
long lastUsed = (System.currentTimeMillis() - p.getLastCompassUsage()) / 1000; long lastUsed = (System.currentTimeMillis() - p.getLastCompassUsage()) / 1000;
p.sendActionBar(Component.text("Du kannst den Kompass erst in " + (10 - lastUsed) + " Sekunden wieder benutzen.")); p.sendActionBar(Component.text("Du kannst den Kompass erst in " + (15 - lastUsed) + " Sekunden wieder benutzen."));
return; return;
} }
p.update_lastCompassUsage();
p.openInventory(compassManager.getInventory()); p.openInventory(compassManager.getInventory());
} }
private void bedUse(NewPlayer player) { private void bedUse(NewPlayer player) {

View File

@ -29,7 +29,7 @@ public class NewPlayer extends Player {
} }
public boolean isAllowCompassUsage() { public boolean isAllowCompassUsage() {
long UsageDifference = System.currentTimeMillis() - lastCompassUsage; long UsageDifference = System.currentTimeMillis() - lastCompassUsage;
long difference = 10000; //in Milisec long difference = 15000; //in Milisec
return UsageDifference >= difference && allowCompassUsage; return UsageDifference >= difference && allowCompassUsage;
} }