mirror of
https://github.com/SunNetservers/MiniGames.git
synced 2024-12-05 00:43:15 +01:00
Removes group record for now
This commit is contained in:
parent
2b9cfeebb1
commit
fe016fd620
@ -111,7 +111,7 @@ follows:
|
||||
| dropper_record | | Denotes that it's a placeholder for a dropper record. Must be present as-is. |
|
||||
| recordType | deaths / time | Selects the type of record to get (deaths or time). |
|
||||
| gameModeType | default / inverted / random | Selects the game-mode to get the record for. |
|
||||
| identifierType | arena / group | The type of thing the following identifier points to (an arena or an arena group). |
|
||||
| identifierType | arena | This specifies that the following string is an arena identifier. |
|
||||
| identifier | ? | An identifier (the name or UUID) for an arena or a group (whichever was chosen as identifierType). |
|
||||
| recordPlacing | 1 / 2 / 3 / ... | The position of the record to get (1 = first place, 2 = second place, etc.). |
|
||||
| infoType | player / value / combined | The type of info to get. Player gets the player name, Value gets the value of the achieved record. Combined gets "Player: Record". |
|
@ -4,7 +4,6 @@ import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import net.knarcraft.dropper.Dropper;
|
||||
import net.knarcraft.dropper.arena.ArenaRecord;
|
||||
import net.knarcraft.dropper.arena.DropperArena;
|
||||
import net.knarcraft.dropper.arena.DropperArenaGroup;
|
||||
import net.knarcraft.dropper.arena.DropperArenaHandler;
|
||||
import net.knarcraft.dropper.arena.DropperArenaRecordsRegistry;
|
||||
import net.knarcraft.dropper.placeholder.parsing.InfoType;
|
||||
@ -76,43 +75,13 @@ public class DropperRecordExpansion extends PlaceholderExpansion {
|
||||
|
||||
String info = null;
|
||||
DropperArenaHandler arenaHandler = plugin.getArenaHandler();
|
||||
if (selectionType == SelectionType.GROUP) {
|
||||
info = getGroupRecord(arenaHandler, identifier, gameMode, recordType, recordNumber, infoType);
|
||||
} else if (selectionType == SelectionType.ARENA) {
|
||||
if (selectionType == SelectionType.ARENA) {
|
||||
info = getArenaRecord(arenaHandler, identifier, gameMode, recordType, recordNumber, infoType);
|
||||
}
|
||||
|
||||
return Objects.requireNonNullElse(info, parameters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a piece of record information from a dropper arena group
|
||||
*
|
||||
* @param arenaHandler <p>The arena handler to get the group from</p>
|
||||
* @param identifier <p>The identifier (name/uuid) selecting the group</p>
|
||||
* @param gameMode <p>The game-mode to get a record for</p>
|
||||
* @param recordType <p>The type of record to get</p>
|
||||
* @param recordNumber <p>The placing of the record to get (1st place, 2nd place, etc.)</p>
|
||||
* @param infoType <p>The type of info (player, value, combined) to get</p>
|
||||
* @return <p>The selected information about the record, or null if not found</p>
|
||||
*/
|
||||
private @Nullable String getGroupRecord(@NotNull DropperArenaHandler arenaHandler, @NotNull String identifier,
|
||||
@NotNull ArenaGameMode gameMode, @NotNull RecordType recordType,
|
||||
int recordNumber, @NotNull InfoType infoType) {
|
||||
// Allow specifying the group UUID or the arena name
|
||||
DropperArenaGroup group;
|
||||
try {
|
||||
group = arenaHandler.getGroup(UUID.fromString(identifier));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
group = arenaHandler.getGroup(identifier);
|
||||
}
|
||||
if (group == null) {
|
||||
return null;
|
||||
}
|
||||
// TODO: Basically, find all UUIDs that exist for all arenas (for selected game mode), and sum them together
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a piece of record information from a dropper arena
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user