Archiviert
13
0

Introduce Properties!

Dieser Commit ist enthalten in:
Chaoscaot 2023-08-16 22:56:25 +02:00
Ursprung 2984d6886a
Commit 88ca2ec7b5
Signiert von: Chaoscaot
GPG-Schlüssel-ID: BDF8FADD7D5EDB7A
8 geänderte Dateien mit 104 neuen und 6 gelöschten Zeilen

27
src/TowerRun.properties Normale Datei
Datei anzeigen

@ -0,0 +1,27 @@
#
# This file is a part of the SteamWar software.
#
# Copyright (C) 2023 SteamWar.de-Serverteam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
PREFIX=§eTowerRun§8» §r
PLAYER_DIED=§c{0} §7died§8!
GAME_START=§aThe game has started§8!
GAME_WIN=§a{0} §7has won the game§8!
GAME_STARTING=§7Starting: §e{0}s§8!
GAME_WAITING=§7Waiting for players§8!
SERVER_STOPPING=§cThe server stops in §e{0}s§8!

25
src/TowerRun_de.properties Normale Datei
Datei anzeigen

@ -0,0 +1,25 @@
#
# This file is a part of the SteamWar software.
#
# Copyright (C) 2023 SteamWar.de-Serverteam
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
PLAYER_DIED=§c{0} §7ist gestorben§8!
GAME_START=§aDas Spiel beginnt§8!
GAME_WIN=§a{0} §7hat das Spiel gewonnen§8!
GAME_STARTING=§7Das Spiel startet in §e{0}s§8!
GAME_WAITING=§7Warte auf weitere Spieler§8...
SERVER_STOPPING=§cDer Server stoppt in §e{0}s§8!

7
src/config.yml Normale Datei
Datei anzeigen

@ -0,0 +1,7 @@
minPlayers: 2
lobbyTimer: 30
destroyable:
- WHITE_WOOL
- FIRE

Datei anzeigen

@ -25,6 +25,7 @@ import de.steamwar.towerrun.state.GameStates;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.scheduler.BukkitTask;
import java.util.EnumSet;
@ -41,6 +42,7 @@ public class EndCountdown extends Countdown {
@Override
void timerEnd() {
Bukkit.getOnlinePlayers().forEach(player -> player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1, 1));
Bukkit.shutdown();
}
@ -51,6 +53,6 @@ public class EndCountdown extends Countdown {
@Override
void run() {
Bukkit.getOnlinePlayers().forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§cServer wird in " + time + " Sekunden heruntergefahren...")));
TowerRun.getMessage().broadcastActionbar("SERVER_STOPPING", time);
}
}

Datei anzeigen

@ -27,6 +27,7 @@ import de.steamwar.towerrun.state.GameStates;
import net.md_5.bungee.api.ChatMessageType;
import net.md_5.bungee.api.chat.TextComponent;
import org.bukkit.Bukkit;
import org.bukkit.Sound;
import org.bukkit.scheduler.BukkitTask;
import java.util.EnumSet;
@ -54,14 +55,15 @@ public class LobbyCountdown extends Countdown {
@Override
void run() {
Bukkit.getOnlinePlayers().forEach(player -> player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("§aStartet: " + time)));
TowerRun.getMessage().broadcastActionbar("GAME_STARTING", time);
if (time < 10) {
Bukkit.getOnlinePlayers().forEach(player -> player.playSound(player.getLocation(), "note.pling", 1, 1));
Bukkit.getOnlinePlayers().forEach(player -> player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1, 1));
}
}
@Override
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");
}
}

Datei anzeigen

@ -19,6 +19,7 @@
package de.steamwar.towerrun.game;
import de.steamwar.towerrun.TowerRun;
import de.steamwar.towerrun.config.WorldConfig;
import de.steamwar.towerrun.state.GameState;
import de.steamwar.towerrun.state.GameStates;
@ -46,7 +47,7 @@ public class TowerRunGame {
PLAYERS_ALIVE.forEach(TowerRunPlayer::reset);
GameState.nextState();
generateLava();
Bukkit.broadcastMessage("§aDas Spiel beginnt!");
TowerRun.getMessage().broadcast("GAME_START");
for (Location door : WorldConfig.DOORS) {
door.getBlock().setType(Material.AIR);
@ -79,7 +80,7 @@ public class TowerRunGame {
PLAYERS_ALIVE.clear();
tPlayer.player().teleport(WorldConfig.SPAWN);
tPlayer.player().setGameMode(GameMode.SPECTATOR);
Bukkit.broadcastMessage("§a" + tPlayer.player().getName() + " hat das Spiel gewonnen!");
TowerRun.getMessage().broadcast("GAME_WIN", tPlayer.player().getName());
GameState.nextState();
}
}

Datei anzeigen

@ -19,6 +19,7 @@
package de.steamwar.towerrun.listener;
import de.steamwar.towerrun.TowerRun;
import de.steamwar.towerrun.config.Config;
import de.steamwar.towerrun.state.GameStateBukkitListener;
import de.steamwar.towerrun.state.GameStates;
@ -44,7 +45,7 @@ public class IngameListener extends GameStateBukkitListener {
public void onPlayerDeath(PlayerDeathEvent event) {
event.setDeathMessage(null);
Bukkit.getOnlinePlayers().forEach(player -> {
player.sendTitle("§c" + event.getEntity().getName() + " ist gestorben!", "", 10, 70, 20);
player.sendTitle("", TowerRun.getMessage().parse("PLAYER_DIED", player, event.getEntity().getPlayer()), 10, 70, 20);
player.playSound(player.getLocation(), Sound.ENTITY_WITHER_DEATH, 1, 1);
});
}

33
src/world.yml Normale Datei
Datei anzeigen

@ -0,0 +1,33 @@
tower:
regions:
1:
minX: 61
maxX: 128
minZ: 308
maxZ: 340
2:
minX: 97
maxX: 128
minZ: 273
maxZ: 340
escapeHeight: 12
spawn:
x: 116
y: 167
z: 297
yaw: 0.0
pitch: 0.0
doors:
1:
x: 117
y: 167
z: 309
2:
x: 116
y: 167
z: 309
lavaY: 220
winconditions:
- LAST_REMAINING
- LAST_OUTSIDE