Refactors
Dieser Commit ist enthalten in:
Ursprung
88ca2ec7b5
Commit
bb3142078f
@ -63,7 +63,6 @@ public class LobbyCountdown extends Countdown {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void timerReset() {
|
void timerReset() {
|
||||||
Bukkit.getOnlinePlayers().forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§cEs wird noch auf Spieler gewartet...")));
|
|
||||||
TowerRun.getMessage().broadcastActionbar("GAME_WAITING");
|
TowerRun.getMessage().broadcastActionbar("GAME_WAITING");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,10 +23,7 @@ import de.steamwar.towerrun.TowerRun;
|
|||||||
import de.steamwar.towerrun.config.WorldConfig;
|
import de.steamwar.towerrun.config.WorldConfig;
|
||||||
import de.steamwar.towerrun.state.GameState;
|
import de.steamwar.towerrun.state.GameState;
|
||||||
import de.steamwar.towerrun.state.GameStates;
|
import de.steamwar.towerrun.state.GameStates;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.*;
|
||||||
import org.bukkit.GameMode;
|
|
||||||
import org.bukkit.Location;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -81,6 +78,10 @@ public class TowerRunGame {
|
|||||||
tPlayer.player().teleport(WorldConfig.SPAWN);
|
tPlayer.player().teleport(WorldConfig.SPAWN);
|
||||||
tPlayer.player().setGameMode(GameMode.SPECTATOR);
|
tPlayer.player().setGameMode(GameMode.SPECTATOR);
|
||||||
TowerRun.getMessage().broadcast("GAME_WIN", tPlayer.player().getName());
|
TowerRun.getMessage().broadcast("GAME_WIN", tPlayer.player().getName());
|
||||||
|
Bukkit.getOnlinePlayers().forEach(player -> {
|
||||||
|
player.sendTitle(TowerRun.getMessage().parse("GAME_WIN", player, tPlayer.player().getName()), "", 10, 70, 20);
|
||||||
|
player.playSound(player.getLocation(), Sound.ENTITY_ENDER_DRAGON_DEATH, 1, 1);
|
||||||
|
});
|
||||||
GameState.nextState();
|
GameState.nextState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ package de.steamwar.towerrun.winconditions;
|
|||||||
import de.steamwar.towerrun.config.WorldConfig;
|
import de.steamwar.towerrun.config.WorldConfig;
|
||||||
import de.steamwar.towerrun.game.TowerRunGame;
|
import de.steamwar.towerrun.game.TowerRunGame;
|
||||||
import de.steamwar.towerrun.game.TowerRunPlayer;
|
import de.steamwar.towerrun.game.TowerRunPlayer;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
@ -31,6 +30,8 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
public abstract class OutsideWincondition extends WinCondition {
|
public abstract class OutsideWincondition extends WinCondition {
|
||||||
|
|
||||||
|
private static final double BASE_GRAVITY = -0.0784000015258789;
|
||||||
|
|
||||||
protected OutsideWincondition(String name) {
|
protected OutsideWincondition(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
@ -51,7 +52,7 @@ public abstract class OutsideWincondition extends WinCondition {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getPlayer().getVelocity().getY() != -0.0784000015258789) {
|
if (event.getPlayer().getVelocity().getY() != BASE_GRAVITY) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren