aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/eu/olli/cowlection/data/HyStalkingData.java
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-07-26 23:41:58 +0200
committerCow <cow@volloeko.de>2020-07-26 23:41:58 +0200
commit0027466a564a9a6bebbdeed05192a616175ea6f3 (patch)
treec6d8b5f61992bd1e418d83b1301cc087f673a2e1 /src/main/java/eu/olli/cowlection/data/HyStalkingData.java
parentb9c5f23a671c50422303bf50e315d364b1354acf (diff)
downloadCowlection-0027466a564a9a6bebbdeed05192a616175ea6f3.tar.gz
Cowlection-0027466a564a9a6bebbdeed05192a616175ea6f3.tar.bz2
Cowlection-0027466a564a9a6bebbdeed05192a616175ea6f3.zip
Replaced 3rd party with official API
Diffstat (limited to 'src/main/java/eu/olli/cowlection/data/HyStalkingData.java')
-rw-r--r--src/main/java/eu/olli/cowlection/data/HyStalkingData.java54
1 files changed, 3 insertions, 51 deletions
diff --git a/src/main/java/eu/olli/cowlection/data/HyStalkingData.java b/src/main/java/eu/olli/cowlection/data/HyStalkingData.java
index a592f2a..771a11d 100644
--- a/src/main/java/eu/olli/cowlection/data/HyStalkingData.java
+++ b/src/main/java/eu/olli/cowlection/data/HyStalkingData.java
@@ -43,14 +43,7 @@ public class HyStalkingData {
}
public String getGameType() {
- String cleanGameType;
- try {
- cleanGameType = GameType.valueOf(gameType).getCleanName();
- } catch (IllegalArgumentException e) {
- // no matching game type found
- cleanGameType = Utils.fancyCase(gameType);
- }
- return cleanGameType;
+ return DataHelper.GameType.getFancyName(gameType);
}
public String getMode() {
@@ -59,7 +52,7 @@ public class HyStalkingData {
return null;
}
String gameType = getGameType();
- if (GameType.BEDWARS.cleanName.equals(gameType)) {
+ if (DataHelper.GameType.BEDWARS.getCleanName().equals(gameType)) {
// BedWars related
String playerMode;
String specialMode;
@@ -92,7 +85,7 @@ public class HyStalkingData {
playerModeClean = playerMode;
}
return Utils.fancyCase(specialMode + playerModeClean);
- } else if (GameType.SKYBLOCK.cleanName.equals(gameType)) {
+ } else if (DataHelper.GameType.SKYBLOCK.getCleanName().equals(gameType)) {
// SkyBlock related
switch (mode) {
case "dynamic":
@@ -123,46 +116,5 @@ public class HyStalkingData {
public String getMap() {
return map;
}
-
- // TODO replace with api request: https://github.com/HypixelDev/PublicAPI/blob/master/Documentation/misc/GameType.md
- public enum GameType {
- QUAKECRAFT("Quakecraft"),
- WALLS("Walls"),
- PAINTBALL("Paintball"),
- SURVIVAL_GAMES("Blitz Survival Games"),
- TNTGAMES("The TNT Games"),
- VAMPIREZ("VampireZ"),
- WALLS3("Mega Walls"),
- ARCADE("Arcade"),
- ARENA("Arena Brawl"),
- UHC("UHC Champions"),
- MCGO("Cops and Crims"),
- BATTLEGROUND("Warlords"),
- SUPER_SMASH("Smash Heroes"),
- GINGERBREAD("Turbo Kart Racers"),
- HOUSING("Housing"),
- SKYWARS("SkyWars"),
- TRUE_COMBAT("Crazy Walls"),
- SPEED_UHC("Speed UHC"),
- SKYCLASH("SkyClash"),
- LEGACY("Classic Games"),
- PROTOTYPE("Prototype"),
- BEDWARS("Bed Wars"),
- MURDER_MYSTERY("Murder Mystery"),
- BUILD_BATTLE("Build Battle"),
- DUELS("Duels"),
- SKYBLOCK("SkyBlock"),
- PIT("Pit");
-
- private final String cleanName;
-
- GameType(String cleanName) {
- this.cleanName = cleanName;
- }
-
- public String getCleanName() {
- return cleanName;
- }
- }
}
}