adding Feedback when player uses compass to often

This commit is contained in:
Martin Olischläger 2023-04-28 19:23:57 +02:00
parent 7cf025376b
commit bdd101114b

View File

@ -19,6 +19,7 @@ public class ItemUseListener implements Consumer<PlayerUseItemEvent> {
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 " + (10 - lastUsed) + " Sekunden wieder benutzen."));
return; return;
} }
p.update_lastCompassUsage(); p.update_lastCompassUsage();