From 545e2b38435a38b2fdeb2ec949110d711437f90b Mon Sep 17 00:00:00 2001 From: Eredrim Date: Wed, 26 Jun 2024 12:48:30 +0200 Subject: [PATCH] refactor: rewrite of Squads module --- doc/mods/squads.md | 63 +++++++++----- doc/modules.md | 83 +++++++++---------- .../net/slipcor/pvparena/core/Config.java | 3 +- .../net/slipcor/pvparena/core/Language.java | 2 + 4 files changed, 84 insertions(+), 67 deletions(-) diff --git a/doc/mods/squads.md b/doc/mods/squads.md index ba138432..9230a50e 100644 --- a/doc/mods/squads.md +++ b/doc/mods/squads.md @@ -1,43 +1,60 @@ # Squads -## Description +## About -This mod allow players to make squads. Instead of respawning anywhere / at the team spawn, you spawn at a random squad member. +This mod makes possible to create squads of players. Instead of respawning anywhere / at the team spawn, a squad player +will respawn to a random mate position. -Squads are an addition to teams or even a replacement (in case of a FFA arena). +Squads are an addition to teams or may a way to group players in FFA arenas. ## Installation Installation of this module can be done in a normal way. You'll find installation process in [modules page](../modules.md#installing-modules) of the doc. -## Usage +## Setup -Place signs, similar to the Class Signs: +This mod works signs to join and leave squads. So, you have to create them. +If you want players can switch between squads during a game (c.f. config settings), you should place squads signs in +the battlefield, in the spawn areas. Otherwise, you should place them directly in the lounges. -``` -[Squad name] -[ignored] -free -free -``` +1. Create a squad using the `/pa [arena] !sq add [squadName] [playerLimit]` command. -You can add another (one) sign below for display of more player names -## Config settings ( in your arena config file ) +2. Then create the join sign using the following template: + ``` + [Squad name] + [what you want / ignored] + empty + empty + ``` + + For instance, for a squad named "icebreakers", you can create a sign like this: + ``` + Icebreakers + <=================> + + + ``` -- modules.squads.ingameSquadSwitch \- allow switching squads ingame + You can add another one or multiple blank signs **below** to display of more player names. -## Commands -- `/pa [arena] !sq` \- show the arena squads -- `/pa [arena] !sq add [name] [limit]` \- add squad with player limit (set to 0 to remove limit) -- `/pa [arena] !sq remove [name]` \- remove squad [name] -- `/pa [arena] !sq set [name] [limit]` \- set player limit for squad +3. Do the same thing for all squads + +
-## Warnings +> **🚩 Tips:** +> - All the squads can be created in a first time with the command and then all signs can be placed. +> Order doesn't matter. +> - The squad name is case-insensitive and supports sign colors -\- +## Config settings -## Dependencies +- **modules.squads.ingameSquadSwitch**: allow switching squads ingame (default: false) -\- +## Commands + +- `/pa [arena] !sq` \- show the arena squads +- `/pa [arena] !sq add [squadName] [playerLimit]` \- add squad with player limit (set to 0 to remove limit) +- `/pa [arena] !sq remove [squadName]` \- remove squad [name] +- `/pa [arena] !sq set [squadName] [playerLimit]` \- set player limit for squad \ No newline at end of file diff --git a/doc/modules.md b/doc/modules.md index b8ddc649..42568389 100644 --- a/doc/modules.md +++ b/doc/modules.md @@ -13,48 +13,47 @@ more information. Hook into many different aspects of the game! -| Mod | Description | Type | Status | -|----------------------------------------------------|---------------------------------------------------------------------------------------------------------|----------|--------| -| [AfterMatch](mods/aftermatch.md) | could also be called "Sudden Death" | | ✔️️ | -| [Announcements](mods/announcements.md) | announce events happening | | ✔️️ | -| [ArenaMaps](mods/arenamaps.md) | a live refreshed map to never lose yourself ever again! | | ✔️️ | -| [BanKick](mods/bankick.md) | ban or kick a player of an arena | | ✔️️ | -| [BattlefieldJoin](mods/battlefieldjoin.md) | join directly your battlefield without using the lounge | JOIN | ✔️️ | -| [BetterClasses](mods/betterclasses.md) | add potion effects and more to specific classes | | ✔️️ | -| [BetterGears](mods/bettergears.md) | automatically colorize classes armors to suit team color | | ✔️️ | -| [BetterFight](mods/betterfight.md) | pack of fun features : one-shot items, kill sounds and explosions on death | | ✔️️ | -| [BetterKillstreaks](mods/betterkillstreaks.md) | reward kill streaks with items or potion effects | | ✔️️ | -| [BlockDissolve](mods/blockdissolve.md) | dissolve blocks under fighting players | | ✔️️ | -| [BlockRestore](mods/blockrestore.md) | restore the battlefield | | ✔️️ | -| [ChestFiller](mods/chestfiller.md) | fill battlefield containers with random and customizable content! | | ✔️️ | -| [Duel](mods/duel.md) | duel someone! | | ⚠️️ | -| [EventActions](mods/eventactions.md) | trigger actions at different moments of the arena lifecycle | | ✔️️ | -| [FlySpectate](mods/flyspectate.md) | have players spectating a fight in fly mode | SPECTATE | ✔️️ | -| [ItemSpawners](mods/itemspawners.md) | spawn (random) items on different points | | ✔️️ | -| [LateLounge](mods/latelounge.md) | keep playing until enough players joined the arena | | ✔️️ | -| [PlayerFinder](mods/playerfinder.md) | allow players to find others with a compass | | ✔️️ | -| [Points](mods/points.md) | allow to restrict certain classes to require players to fight for better classes | | ⚠️ | -| [PowerUps](mods/powerups.md) | spawn items giving special powers | | ☑️️ | -| [Projectiles](mods/projectiles.md) | add knockback to throwable items (snowballs, eggs, etc) | | ✔️️ | -| [QuickLounge](mods/quicklounge.md) | join a lounge which starts the game automatically | JOIN | ✔️️ | -| [RealSpectate](mods/realspectate.md) | spectate the game, CounterStrike style! | SPECTATE | ✔️️ | -| [RespawnRelay](mods/respawnrelay.md) | add a relay for respawning players | | ✔️️ | -| [Skins](mods/skins.md) | add custom skins to teams/classes | | ❌ | -| [SpawnCollections](mods/spawncollections.md) | save different spawn configurations of the battlefield and switch between them | | ✔️️ | -| [Spectate](mods/spectate.md) | use the new 1.8 SPECTATOR mode to allow flying and POV spectating | SPECTATE | ✔️️ | -| StandardLounge | Default lounge module | JOIN | ✔️️ | -| StandardSpectate | Default spectate module (survival mode) | SPECTATE | ✔️️ | -| [Squads](mods/squads.md) | add squads to the game, basically only showing players belonging together apart from teams and classes. | | ☑️️ | -| [StartFreeze](mods/startfreeze.md) | freeze players at start | | ✔️️ | -| [TeamSizeRestrict](mods/teamsizerestrict.md) | a small mod to restrict the size of specific teams | | ✔️️ | -| [TempPerms](mods/tempperms.md) | add temporary perms | | ✔️️ | -| [Titles](mods/titles.md) | send messages to players as the "title" command would do | | ✔️️ | -| [Turrets](mods/turrets.md) | add turrets where players fire projectiles | | ⚠️ | -| [Vault](mods/vault.md) | add economy, money rewards and bet features | | ✔️️ | -| [Walls](mods/walls.md) | define wall regions to simulate "The Walls" | | ⚠️ | -| [WarmupJoin](mods/warmupjoin.md) | ??? | JOIN | ⚠️ | -| [WorldEdit](mods/worldedit.md) | backup/restore regions | | ✔️️ | -| [WorldGuard](mods/worldguard.md) | import region definitions from WorldGuard | | ⚠️ | +| Mod | Description | Type | Status | +|------------------------------------------------|----------------------------------------------------------------------------------|----------|--------| +| [AfterMatch](mods/aftermatch.md) | could also be called "Sudden Death" | | ✔️️ | +| [Announcements](mods/announcements.md) | announce events happening | | ✔️️ | +| [ArenaMaps](mods/arenamaps.md) | a live refreshed map to never lose yourself ever again! | | ✔️️ | +| [BanKick](mods/bankick.md) | ban or kick a player of an arena | | ✔️️ | +| [BattlefieldJoin](mods/battlefieldjoin.md) | join directly your battlefield without using the lounge | JOIN | ✔️️ | +| [BetterClasses](mods/betterclasses.md) | add potion effects and more to specific classes | | ✔️️ | +| [BetterGears](mods/bettergears.md) | automatically colorize classes armors to suit team color | | ✔️️ | +| [BetterFight](mods/betterfight.md) | pack of fun features : one-shot items, kill sounds and explosions on death | | ✔️️ | +| [BetterKillstreaks](mods/betterkillstreaks.md) | reward kill streaks with items or potion effects | | ✔️️ | +| [BlockDissolve](mods/blockdissolve.md) | dissolve blocks under fighting players | | ✔️️ | +| [BlockRestore](mods/blockrestore.md) | restore the battlefield | | ✔️️ | +| [ChestFiller](mods/chestfiller.md) | fill battlefield containers with random and customizable content! | | ✔️️ | +| [Duel](mods/duel.md) | duel someone! | | ⚠️️ | +| [EventActions](mods/eventactions.md) | trigger actions at different moments of the arena lifecycle | | ✔️️ | +| [FlySpectate](mods/flyspectate.md) | have players spectating a fight in fly mode | SPECTATE | ✔️️ | +| [ItemSpawners](mods/itemspawners.md) | spawn (random) items on different points | | ✔️️ | +| [LateLounge](mods/latelounge.md) | keep playing until enough players joined the arena | | ✔️️ | +| [PlayerFinder](mods/playerfinder.md) | allow players to find others with a compass | | ✔️️ | +| [Points](mods/points.md) | allow to restrict certain classes to require players to fight for better classes | | ⚠️ | +| [PowerUps](mods/powerups.md) | spawn items giving special powers | | ☑️️ | +| [Projectiles](mods/projectiles.md) | add knockback to throwable items (snowballs, eggs, etc) | | ✔️️ | +| [QuickLounge](mods/quicklounge.md) | join a lounge which starts the game automatically | JOIN | ✔️️ | +| [RealSpectate](mods/realspectate.md) | spectate the game, CounterStrike style! | SPECTATE | ✔️️ | +| [RespawnRelay](mods/respawnrelay.md) | add a relay for respawning players | | ✔️️ | +| [Skins](mods/skins.md) | add custom skins to teams/classes | | ❌ | +| [SpawnCollections](mods/spawncollections.md) | save different spawn configurations of the battlefield and switch between them | | ✔️️ | +| [Spectate](mods/spectate.md) | use the new 1.8 SPECTATOR mode to allow flying and POV spectating | SPECTATE | ✔️️ | +| StandardLounge | Default lounge module | JOIN | ✔️️ | +| StandardSpectate | Default spectate module (survival mode) | SPECTATE | ✔️️ | +| [Squads](mods/squads.md) | add squads to the game, create group of players respawning together | | ✔️️ | +| [StartFreeze](mods/startfreeze.md) | freeze players at start | | ✔️️ | +| [TeamSizeRestrict](mods/teamsizerestrict.md) | a small mod to restrict the size of specific teams | | ✔️️ | +| [TempPerms](mods/tempperms.md) | add temporary perms | | ✔️️ | +| [Titles](mods/titles.md) | send messages to players as the "title" command would do | | ✔️️ | +| [Turrets](mods/turrets.md) | add turrets where players fire projectiles | | ⚠️ | +| [Vault](mods/vault.md) | add economy, money rewards and bet features | | ✔️️ | +| [Walls](mods/walls.md) | define wall regions to simulate "The Walls" | | ⚠️ | +| [WarmupJoin](mods/warmupjoin.md) | ??? | JOIN | ⚠️ | +| [WorldEdit](mods/worldedit.md) | backup/restore regions | | ✔️️ | **Key :** ✔️️ Adapted and fully tested for 2.0 | ☑️ Fully works with previous PVPArena version, but not tested with 2.0 | ⚠️ Legacy modules, not tested for a while | ❌ Temporarily unavailable diff --git a/src/main/java/net/slipcor/pvparena/core/Config.java b/src/main/java/net/slipcor/pvparena/core/Config.java index 3909eac2..fe8cf929 100644 --- a/src/main/java/net/slipcor/pvparena/core/Config.java +++ b/src/main/java/net/slipcor/pvparena/core/Config.java @@ -361,8 +361,7 @@ public enum CFG { MODULES_SKINS_VANILLA("modules.skins.vanilla", false, "Skins"), - MODULES_SQUADS_AUTOSQUAD("modules.squads.autoSquad", "none", "Squads"), - MODULES_SQUADS_INGAMESWITCH("modules.squads.ingameSquadSwitch", true, "Squads"), + MODULES_SQUADS_INGAMESWITCH("modules.squads.ingameSquadSwitch", false, "Squads"), MODULES_STARTFREEZE_TIMER("modules.startfreeze.freezetimer", 5, "StartFreeze"), diff --git a/src/main/java/net/slipcor/pvparena/core/Language.java b/src/main/java/net/slipcor/pvparena/core/Language.java index d97dbc73..61d650cf 100644 --- a/src/main/java/net/slipcor/pvparena/core/Language.java +++ b/src/main/java/net/slipcor/pvparena/core/Language.java @@ -689,6 +689,8 @@ public enum MSG { MODULE_SQUADS_SET("nulang.mod.squads.set", "Squad %1% has been set"), MODULE_SQUADS_REMOVED("nulang.mod.squads.removed", "Squad %1% has been removed"), MODULE_SQUADS_NOTEXIST("nulang.mod.squads.notexist", "Squad %1% doesn't exist!"), + MODULE_SQUADS_JOIN("nulang.mod.squads.join", "You have joined the squad &b%1%&r!"), + MODULE_SQUADS_LEAVE("nulang.mod.squads.leave", "You left the squad &b%1%&r!"), MODULE_SQUADS_ERROR("nulang.mod.squads.error", "Error while editing squads, syntax is not correct!"), MODULE_SQUADS_FULL("nulang.mod.squads.full", "This squad is full!"), MODULE_SQUADS_HELP("nulang.mod.squads.help", "/pa !sq | show the arena squads\n/pa !sq add [name] [limit] | add squad with player limit (set to 0 for no limit)\n/pa !sq set [name] [limit] | set player limit for squad\n/pa !sq remove [name] | remove squad [name]"),