Merge remote-tracking branch 'origin/master'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Commit
c59082320b
@ -150,7 +150,7 @@ GAMES_LEFT = §7{0} left the game
|
||||
|
||||
BOAT_RACE_TIME = §7Finished in §e{0}
|
||||
BOAT_RACE_NEW_BEST = §aNew best time!
|
||||
BOAT_RACE_TITLE = §6Checkpoint {0}/6§7: {1}
|
||||
BOAT_RACE_TITLE = §6Checkpoint {0}/6§7: {1} §8• §e{2}km/h
|
||||
|
||||
# Easter Egg Hunt
|
||||
DIFFICULTY_EASY = §aEasy
|
||||
|
@ -57,11 +57,14 @@ public class BoatRace implements EventListener, Listener {
|
||||
private final BukkitTask task;
|
||||
private final BossBar bossBar;
|
||||
private boolean hasBacked = false;
|
||||
private double lastDistance;
|
||||
|
||||
@EventHandler
|
||||
public void onBoatMove(VehicleMoveEvent event) {
|
||||
if (event.getVehicle() != boat) return;
|
||||
|
||||
lastDistance = event.getFrom().distance(event.getTo());
|
||||
|
||||
if(nextCheckpoint == 0 && inRegion(player, BoatRacePositions.BACKWARDS[0], BoatRacePositions.BACKWARDS[1])) {
|
||||
player.eject();
|
||||
player.teleport(BoatRacePositions.END);
|
||||
@ -137,8 +140,9 @@ public class BoatRace implements EventListener, Listener {
|
||||
task = Bukkit.getScheduler().runTaskTimer(LobbySystem.getPlugin(), () -> {
|
||||
hasBacked = false;
|
||||
if (nextCheckpoint != 0) {
|
||||
double kmh = lastDistance * 20 * 3.6;
|
||||
bossBar.setProgress((nextCheckpoint - 1d) / (BoatRacePositions.CHECKPOINTS.length - 1d));
|
||||
bossBar.setTitle(LobbySystem.getMessage().parse("BOAT_RACE_TITLE", player, nextCheckpoint, renderTime(System.currentTimeMillis() - startTime)));
|
||||
bossBar.setTitle(LobbySystem.getMessage().parse("BOAT_RACE_TITLE", player, nextCheckpoint, renderTime(System.currentTimeMillis() - startTime), (int) kmh));
|
||||
}
|
||||
}, 0, 1);
|
||||
Bukkit.getPluginManager().registerEvents(this, LobbySystem.getPlugin());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren