From cbb0dcf8ebdf4ceffb627489d07cc1599f0fada6 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 13 Jun 2023 22:00:43 +0200 Subject: [PATCH] Some of the requested changes Signed-off-by: Lixfel --- .../fightsystem/FightSystem.properties | 22 ++----------------- .../fightsystem/FightSystem_de.properties | 22 ++----------------- .../de/steamwar/fightsystem/commands/GUI.java | 9 ++++---- .../steamwar/fightsystem/fight/FightTeam.java | 2 +- .../steamwar/fightsystem/fight/HotbarKit.java | 4 ++-- .../fightsystem/fight/JoinRequest.java | 2 +- .../listener/JoinRequestListener.java | 2 +- .../fightsystem/listener/Permanent.java | 4 ++-- 8 files changed, 16 insertions(+), 51 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties index 0611c3e..a6ab2ab 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties @@ -25,13 +25,6 @@ FIGHT_ALREADY_STARTED=§cThe fight already started NOT_LEADER=§cYou aren't a leader PLAYER_UNAVAILABLE=§cThe player is not in an arena -NO_INVITATION=§cYou weren't invited by any team -INVITATION_DECLINED=§cInvitation declined -INVITATION_DECLINED_TEAM=§e{0} §chas declined the invitation -PLAYER_IN_TEAM=§e{0} §cis already in a team -ALREADY_INVITED=§e{0} §cwas invited -INVITATION_SENT=§e{0} §7invited - NOT_IN_TEAM=§e{0} §cis not in your team KIT_UNAVAILABLE=§cThis kit does not exist @@ -41,8 +34,6 @@ GAMEMODE_NOT_ALLOWED=§cChanging gamemode is not permitted GAMEMODE_UNKNOWN=§cUnknown gamemode {0} GAMEMODE_HELP=§8/§7gm §8[§egamemode§8] -INVITE_HELP=§8/§einvite §8[§eplayer§8] - LEADER_FULL=§cAll teams already have a leader ALREADY_IN_TEAM=§cYou are already in a team @@ -58,12 +49,6 @@ WIN_HELP=§8/§7win §8[§eteam §8or §etie§8] # GUI -INVITATION_TITLE=Invitation from {0} -INVITATION_ACCEPT=§aAccept -INVITATION_DECLINE=§cDecline -INVITATION_CHAT_ACCEPT=§8/§aaccept§8, §7to §aaccept§7 the invitation -INVITATION_CHAT_DECLINE=§8/§cdecline§8, §7to §cdecline§7 the invitation - STATE_TITLE=Fight state STATE_PRE_LEADER_SETUP=§7Team leader waiting phase STATE_PRE_SCHEM_SETUP=§7Schematic selection phase @@ -73,8 +58,6 @@ STATE_RUNNING=§eFighting phase STATE_SPECTATE_WIN=§7Victory {0} STATE_SPECTATE_TIE=§7Draw -INVITE_TITLE=Invite player - REMOVE_TITLE=Kick player KIT_SELECTION_TITLE=Kit selection @@ -119,7 +102,6 @@ SKIP_NOT_READY=§c§mSkipping to next event TEAM_CHAT={0}{1}§8» {0}{2} CHOOSE_KIT=§eChoose kit RESPAWN=§eRespawn -INVITE_PLAYERS=§eInvite player REMOVE_PLAYERS=§cKick player CHOOSE_SCHEMATIC=§eChoose {0} SCHEMATIC_REQUIRED=§cChoose a schematic first @@ -250,14 +232,14 @@ AMONG_US_IMPOSTER_AMONG_MESSAGE = §4There is an Imposter among us§8! §7Kill h JOIN_REQUEST=§7Request join JOIN_REQUEST_TITLE=Request join JOIN_REQUEST_ALREADY=§cYou have already sent a join request -JOIN_REQUEST_TEAM=§eJoin {0} +JOIN_REQUEST_TEAM=§7Join {0} JOIN_REQUEST_CONFIRMATION=§7Join request submitted JOIN_REQUEST_NOTIFICATION=§e{0} §7requests joining team {1}§8. §7Accept or decline using §8/§erequests REQUESTS=§7Open join requests REQUESTS_TITLE=Open join requests REQUEST_DECLINED=§cJoin of {0} declined -YOUR_REQUEST_DECLINED=§cYour join request was declined +REQUEST_YOUR_DECLINED=§cYour join request was declined REQUESTS_LEFT_CLICK=§eLeft click §7to §eaccept§8! REQUESTS_RIGHT_CLICK=§eRight click §7to §edecline§8! diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties index 0bd4755..415652c 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem_de.properties @@ -23,13 +23,6 @@ FIGHT_ALREADY_STARTED=§cDer Kampf hat bereits begonnen NOT_LEADER=§cDu bist kein Leader PLAYER_UNAVAILABLE=§cDer Spieler ist nicht in der Arena -NO_INVITATION=§cDu wurdest von keinem Team eingeladen -INVITATION_DECLINED=§cEinladung abgelehnt -INVITATION_DECLINED_TEAM=§e{0} §chat die Einladung abgelehnt -PLAYER_IN_TEAM=§e{0} §cist bereits in einem Team -ALREADY_INVITED=§e{0} §cwurde bereits eingeladen -INVITATION_SENT=§e{0} §7eingeladen - NOT_IN_TEAM=§e{0} §cist nicht in deinem Team KIT_UNAVAILABLE=§cDieses Kit gibt es nicht @@ -39,8 +32,6 @@ GAMEMODE_NOT_ALLOWED=§cSpielmodusänderung verboten GAMEMODE_UNKNOWN=§cUnbekannter Spielmodus {0} GAMEMODE_HELP=§8/§7gm §8[§eSpielmodus§8] -INVITE_HELP=§8/§einvite §8[§eSpieler§8] - LEADER_FULL=§cAlle Teams haben bereits einen Leader ALREADY_IN_TEAM=§cDu bist bereits in einem Team @@ -56,12 +47,6 @@ WIN_HELP=§8/§7win §8[§eTeam §8oder §etie§8] # GUI -INVITATION_TITLE=Einladung von {0} -INVITATION_ACCEPT=§aAnnehmen -INVITATION_DECLINE=§cAblehnen -INVITATION_CHAT_ACCEPT=§8/§aaccept§8, §7um die Einladung §aanzunehmen -INVITATION_CHAT_DECLINE=§8/§cdecline§8, §7um die Einladung §cabzulehnen - STATE_TITLE=Kampfstatus STATE_PRE_LEADER_SETUP=§7Teamleaderwartephase STATE_PRE_SCHEM_SETUP=§7Schemauswahlphase @@ -71,8 +56,6 @@ STATE_RUNNING=§eKampfphase STATE_SPECTATE_WIN=§7Sieg {0} STATE_SPECTATE_TIE=§7Unentschieden -INVITE_TITLE=Spieler einladen - REMOVE_TITLE=Spieler rauswerfen KIT_SELECTION_TITLE=Kitauswahl @@ -116,7 +99,6 @@ SKIP_READY=§aBeschleunigung zum nächsten Event SKIP_NOT_READY=§c§mBeschleunigung zum nächsten Event CHOOSE_KIT=§eKit wählen RESPAWN=§eRespawn -INVITE_PLAYERS=§eSpieler einladen REMOVE_PLAYERS=§cSpieler rauswerfen CHOOSE_SCHEMATIC=§e{0} wählen SCHEMATIC_REQUIRED=§cZuerst muss eine Schematic gewählt sein @@ -234,14 +216,14 @@ AMONG_US_IMPOSTER_AMONG_MESSAGE = §4Es ist ein Imposter unter uns§8! §7Tötet JOIN_REQUEST=§7Teambeitritt anfragen JOIN_REQUEST_TITLE=Teambeitritt anfragen JOIN_REQUEST_ALREADY=§cDu hast bereits ein Team um Beitritt angefragt -JOIN_REQUEST_TEAM={0} §ebeitreten +JOIN_REQUEST_TEAM={0} §7beitreten JOIN_REQUEST_CONFIRMATION=§7Teambeitritt angefragt JOIN_REQUEST_NOTIFICATION=§e{0} §7möchte Team {1} §7beitreten§8. §7Akzeptiere oder lehne ab mit §8/§erequests REQUESTS=§7Offene Beitrittsanfragen REQUESTS_TITLE=Offene Beitrittsanfragen REQUEST_DECLINED=§cBeitritt von {0} abgelehnt -YOUR_REQUEST_DECLINED=§cDeine Betrittsanfrage wurde abgelehnt +REQUEST_YOUR_DECLINED=§cDeine Betrittsanfrage wurde abgelehnt REQUESTS_LEFT_CLICK=§eLinksklick §7um §eanzunehmen§8! REQUESTS_RIGHT_CLICK=§eRechtsklick §7um §eabzulehnen§8! diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java b/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java index a160962..cb63550 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/commands/GUI.java @@ -61,10 +61,11 @@ public class GUI { } SWInventory inv = new SWInventory(p, 9, msg.parse("JOIN_REQUEST_TITLE", p)); - if(!Fight.getRedTeam().isPlayerInTeam(p)) - addTeamRequest(p, inv, 0, Fight.getBlueTeam()); - if(!Fight.getBlueTeam().isPlayerInTeam(p)) - addTeamRequest(p, inv, 8, Fight.getRedTeam()); + FightTeam team = Fight.getPlayerTeam(p); + if(team != Fight.getRedTeam()) + addTeamRequest(p, inv, team == null ? 0 : 4, Fight.getBlueTeam()); + if(team != Fight.getBlueTeam()) + addTeamRequest(p, inv, team == null ? 8 : 4, Fight.getRedTeam()); inv.open(); } diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java index a877f9f..ecd5b8a 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java @@ -307,7 +307,7 @@ public class FightTeam { if(player.isOnline()){ FightSystem.getTechHider().reloadChunks(player, chunksToReload, true); - HotbarKit.spectatorKit.loadToPlayer(player); + HotbarKit.SPECTATOR_KIT.loadToPlayer(player); } } diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java index 044fea5..8310d2c 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/HotbarKit.java @@ -48,10 +48,10 @@ import java.util.function.Consumer; public class HotbarKit extends Kit { - public static final HotbarKit spectatorKit = new HotbarKit(); + public static final HotbarKit SPECTATOR_KIT = new HotbarKit(); static { for(int i = 0; i < 9; i++) - spectatorKit.setItem(i, "JOIN_REQUEST", new ItemBuilder(Material.PAPER).removeAllAttributes().build(), GUI::joinRequest); + SPECTATOR_KIT.setItem(i, "JOIN_REQUEST", new ItemBuilder(Material.PAPER).removeAllAttributes().build(), GUI::joinRequest); } private static final int HOTBAR_SIZE = 9; diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/JoinRequest.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/JoinRequest.java index cf4acc6..13ab67a 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/JoinRequest.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/JoinRequest.java @@ -93,7 +93,7 @@ public class JoinRequest { } public void decline(FightTeam declinor) { - FightSystem.getMessage().sendPrefixless("YOUR_REQUEST_DECLINED", player, ChatMessageType.ACTION_BAR); + FightSystem.getMessage().sendPrefixless("REQUEST_YOUR_DECLINED", player, ChatMessageType.ACTION_BAR); waitOnApproval.forEach(t -> t.broadcast("REQUEST_DECLINED", player.getName())); silentDecline(); } diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/JoinRequestListener.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/JoinRequestListener.java index 11ab3be..ad634a2 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/JoinRequestListener.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/JoinRequestListener.java @@ -50,7 +50,7 @@ public class JoinRequestListener implements Listener { Player player = event.getPlayer(); if (!Config.ArenaLeaveable && !Fight.fighting(player)) { - HotbarKit.spectatorKit.loadToPlayer(player); + HotbarKit.SPECTATOR_KIT.loadToPlayer(player); } } diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java index de63b33..cb17931 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java @@ -77,7 +77,7 @@ public class Permanent implements Listener { FightTeam team = Fight.getPlayerTeam(player); event.setRespawnLocation(team == null ? Config.SpecSpawn : team.getSpawn()); - HotbarKit.spectatorKit.loadToPlayer(player); + HotbarKit.SPECTATOR_KIT.loadToPlayer(player); } } @@ -103,7 +103,7 @@ public class Permanent implements Listener { player.teleport(Config.SpecSpawn); } else if(fp != null && !fp.isLiving()) { Fight.setPlayerGamemode(player, GameMode.SPECTATOR); - HotbarKit.spectatorKit.loadToPlayer(player); + HotbarKit.SPECTATOR_KIT.loadToPlayer(player); player.teleport(fp.getTeam().getSpawn()); } }