This commit is contained in:
Stachelbeere1248 2023-11-18 01:42:55 +01:00
parent a7a206d273
commit acb51e6a3a
15 changed files with 267 additions and 112 deletions

View file

@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xmx2g
baseGroup = com.github.stachelbeere1248.zombiesutils baseGroup = com.github.stachelbeere1248.zombiesutils
mcVersion = 1.8.9 mcVersion = 1.8.9
modid = zombiesutils modid = zombiesutils
version = 1.1.2 version = 1.1.3

View file

@ -5,6 +5,7 @@ import com.github.stachelbeere1248.zombiesutils.commands.SlaCommand;
import com.github.stachelbeere1248.zombiesutils.config.Hotkeys; import com.github.stachelbeere1248.zombiesutils.config.Hotkeys;
import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig;
import com.github.stachelbeere1248.zombiesutils.handlers.ChatHandler; import com.github.stachelbeere1248.zombiesutils.handlers.ChatHandler;
import com.github.stachelbeere1248.zombiesutils.handlers.KeyInputHandler;
import com.github.stachelbeere1248.zombiesutils.handlers.TickHandler; import com.github.stachelbeere1248.zombiesutils.handlers.TickHandler;
import com.github.stachelbeere1248.zombiesutils.render.RenderGameOverlayHandler; import com.github.stachelbeere1248.zombiesutils.render.RenderGameOverlayHandler;
import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.ClientCommandHandler;
@ -44,7 +45,7 @@ public class ZombiesUtils {
MinecraftForge.EVENT_BUS.register(new RenderGameOverlayHandler()); MinecraftForge.EVENT_BUS.register(new RenderGameOverlayHandler());
MinecraftForge.EVENT_BUS.register(new TickHandler()); MinecraftForge.EVENT_BUS.register(new TickHandler());
MinecraftForge.EVENT_BUS.register(new ChatHandler()); MinecraftForge.EVENT_BUS.register(new ChatHandler());
MinecraftForge.EVENT_BUS.register(hotkeys); MinecraftForge.EVENT_BUS.register(new KeyInputHandler());
ClientCommandHandler.instance.registerCommand(new CategoryCommand()); ClientCommandHandler.instance.registerCommand(new CategoryCommand());
ClientCommandHandler.instance.registerCommand(new SlaCommand()); ClientCommandHandler.instance.registerCommand(new SlaCommand());

View file

@ -19,12 +19,12 @@ public class CategoryCommand extends CommandBase {
} }
@Override @Override
public String getCommandName() { public String getCommandName() {
return "runCategory"; return "category";
} }
@Override @Override
public String getCommandUsage(ICommandSender sender) { public String getCommandUsage(ICommandSender sender) {
return "runCategory <category-name>"; return "/category <category-name>";
} }
@Override @Override

View file

@ -28,90 +28,89 @@ public class SlaCommand extends CommandBase {
public void processCommand(ICommandSender sender, String @NotNull [] args) throws CommandException { public void processCommand(ICommandSender sender, String @NotNull [] args) throws CommandException {
if (args.length == 0) throw new WrongUsageException( if (args.length == 0) throw new WrongUsageException(
"[Missing option] options: off, offset, rotate, mirror, map, quick"); "[Missing option] options: off, offset, rotate, mirror, map, quick");
else { else switch (args[0]) {
switch (args[0]) { case "off":
case "off": SLA.drop();
SLA.drop(); sender.addChatMessage(new ChatComponentText("SLA data deleted"));
sender.addChatMessage(new ChatComponentText("SLA data deleted")); break;
break; case "offset":
case "offset": if (args.length == 1) SLA.getInstance().ifPresent(SLA::resetOffset);
if (args.length == 1) SLA.getInstance().ifPresent(SLA::resetOffset); else if (args.length != 4) throw new WrongUsageException(
else if (args.length != 4) throw new WrongUsageException( "An offset should have three coordinates!");
"An offset should have three coordinates!"); else {
else { try {
try { int x = Integer.parseInt(args[1]);
int x = Integer.parseInt(args[1]); int y = Integer.parseInt(args[2]);
int y = Integer.parseInt(args[2]); int z = Integer.parseInt(args[3]);
int z = Integer.parseInt(args[3]); SLA.getInstance().ifPresent(sla -> sla.setOffset(new int[]{x, y, z}));
SLA.getInstance().ifPresent(sla -> sla.setOffset(new int[]{x, y, z})); } catch (NumberFormatException ignored) {
} catch (NumberFormatException ignored) { throw new NumberInvalidException("Invalid Integer:", args[1]);
throw new NumberInvalidException("Invalid Integer:", args[1]);
}
} }
break; }
case "rotate": break;
if (args.length == 1) SLA.getInstance().ifPresent(sla -> sla.rotate(1)); case "rotate":
else { if (args.length == 1) SLA.getInstance().ifPresent(sla -> sla.rotate(1));
int rotations; else {
try { int rotations;
rotations = Integer.parseInt(args[1]); try {
} catch (NumberFormatException ignored) { rotations = Integer.parseInt(args[1]);
throw new NumberInvalidException("Invalid Integer:", args[1]); } catch (NumberFormatException ignored) {
} throw new NumberInvalidException("Invalid Integer:", args[1]);
SLA.getInstance().ifPresent(sla -> sla.rotate(rotations));
} }
break; SLA.getInstance().ifPresent(sla -> sla.rotate(rotations));
case "mirror": }
switch (args[1]) { break;
case "x": case "mirror":
SLA.getInstance().ifPresent(SLA::mirrorX); switch (args[1]) {
break; case "x":
case "z": SLA.getInstance().ifPresent(SLA::mirrorX);
SLA.getInstance().ifPresent(SLA::mirrorZ); break;
break; case "z":
default: SLA.getInstance().ifPresent(SLA::mirrorZ);
throw new WrongUsageException("Invalid option: available: x, z"); break;
} default:
break; throw new WrongUsageException("Invalid option: available: x, z");
case "map": }
switch (args[1]) { break;
case "de": case "map":
SLA.instance = new SLA(Map.DEAD_END); switch (args[1]) {
break; case "de":
case "bb": SLA.instance = new SLA(Map.DEAD_END);
SLA.instance = new SLA(Map.BAD_BLOOD); break;
break; case "bb":
case "aa": SLA.instance = new SLA(Map.BAD_BLOOD);
SLA.instance = new SLA(Map.ALIEN_ARCADIUM); break;
break; case "aa":
default: SLA.instance = new SLA(Map.ALIEN_ARCADIUM);
throw new WrongUsageException( break;
"[Invalid option] options: de, bb, aa", args[1]); default:
} throw new WrongUsageException(
break; "[Invalid option] options: de, bb, aa", args[1]);
case "quick": }
switch (args[1]) { break;
case "quick":
switch (args[1]) {
//noinspection SpellCheckingInspection
case "mogi_a":
QuickSLA.mogi_a();
break;
//noinspection SpellCheckingInspection
case "ghxula":
QuickSLA.ghxula();
break;
//noinspection SpellCheckingInspection
case "ghxula-garden":
QuickSLA.ghxulaGarden();
break;
default:
//noinspection SpellCheckingInspection //noinspection SpellCheckingInspection
case "mogi_a": throw new WrongUsageException(
QuickSLA.mogi_a(); "[Invalid option] options: mogi_a, ghxula, ghxula-garden", args[1]);
break; }
//noinspection SpellCheckingInspection break;
case "ghxula": default:
QuickSLA.ghxula(); throw new WrongUsageException(
break; "[Invalid option] options: off, offset, rotate, mirror, map", args[0]);
//noinspection SpellCheckingInspection
case "ghxula-garden":
QuickSLA.ghxulaGarden();
break;
default:
//noinspection SpellCheckingInspection
throw new WrongUsageException(
"[Invalid option] options: mogi_a, ghxula, ghxula-garden", args[1]); }
break;
default:
throw new WrongUsageException(
"[Invalid option] options: off, offset, rotate, mirror, map", args[0]);
}
} }
} }
@ -136,7 +135,7 @@ public class SlaCommand extends CommandBase {
case "quick": case "quick":
//noinspection SpellCheckingInspection //noinspection SpellCheckingInspection
options.addAll(Arrays.asList("mogi_a", "ghxula", "ghxula-garden")); options.addAll(Arrays.asList("mogi_a", "ghxula", "ghxula-garden"));
default: default: break;
} }
} }
return options; return options;

View file

@ -0,0 +1,68 @@
package com.github.stachelbeere1248.zombiesutils.commands;
import com.github.stachelbeere1248.zombiesutils.timer.Timer;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.Category;
import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard;
import net.minecraft.command.*;
import net.minecraft.util.BlockPos;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class ZombiesUtilsCommand extends CommandBase {
@Override
public String getCommandName() {
return "zombiesutils";
}
@Override
public String getCommandUsage(ICommandSender sender) {
return "/zombiesutils";
}
@Override
public void processCommand(ICommandSender sender, String @NotNull [] args) throws CommandException {
if (args.length == 0) throw new WrongUsageException(
"[Missing option] options: timer");
else switch (args[0]) {
case "timer":
switch (args[1]) {
case "kill": Timer.dropInstances(); break;
case "split":
try {
Timer.getInstance().ifPresent(timer -> timer.split(Byte.parseByte(args[2])));
} catch (NumberFormatException | NullPointerException ignored) {
throw new NumberInvalidException("t",args[2]);
} break;
case "start": new Timer(
Scoreboard.getServerNumber().orElseThrow(() -> new RuntimeException("cannot figure out servernumber")),
Scoreboard.getMap().orElseThrow(() -> new RuntimeException("cannot figure out map")).map
); break;
default:
throw new WrongUsageException(
"[Invalid option] options: kill, split, start", args[0]);
} break;
default:
throw new WrongUsageException(
"[Invalid option] options: timer", args[0]);
}
}
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String @NotNull [] args, BlockPos blockPos) {
if (args.length == 1) return new ArrayList<>(Collections.singleton("timer"));
switch (args[0]) {
case "timer":
return new ArrayList<>(Arrays.asList("kill","split","start"));
default: return Collections.emptyList();
}
}
@Override
public boolean canCommandSenderUseCommand(ICommandSender sender) {
return true;
}
}

View file

@ -9,6 +9,7 @@ import org.lwjgl.input.Keyboard;
public class Hotkeys { public class Hotkeys {
private final KeyBinding chatMacro; private final KeyBinding chatMacro;
private final KeyBinding debug;
public Hotkeys() { public Hotkeys() {
chatMacro = new KeyBinding( chatMacro = new KeyBinding(
@ -16,14 +17,20 @@ public class Hotkeys {
Keyboard.KEY_Q, Keyboard.KEY_Q,
"Zombies Utils" "Zombies Utils"
); );
debug = new KeyBinding(
"Debug",
Keyboard.KEY_K,
"Zombies Utils"
);
} }
public void registerAll() { public void registerAll() {
ClientRegistry.registerKeyBinding(this.chatMacro); ClientRegistry.registerKeyBinding(this.chatMacro);
ClientRegistry.registerKeyBinding(this.debug);
} }
@SubscribeEvent public KeyBinding getChatMacro() {
public void onKeyInput(InputEvent.KeyInputEvent event) { return chatMacro;
if (Keyboard.getEventKey() == chatMacro.getKeyCode() && Keyboard.getEventKeyState() && Minecraft.getMinecraft().currentScreen == null) { }
Minecraft.getMinecraft().thePlayer.sendChatMessage(ZombiesUtilsConfig.getChatMacro()); public KeyBinding getDebugger() {
} return debug;
} }
} }

View file

@ -0,0 +1,49 @@
package com.github.stachelbeere1248.zombiesutils.handlers;
import com.github.stachelbeere1248.zombiesutils.ZombiesUtils;
import com.github.stachelbeere1248.zombiesutils.config.Hotkeys;
import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import org.lwjgl.input.Keyboard;
public class KeyInputHandler {
/*
@SuppressWarnings("SpellCheckingInspection")
private final String[] secret = new String[]{
"Rule #1: Use Zombies Utils.",
"Rule #2: Use the god damn maarkro.",
"Rule #3: Be as toxic as possible (not).",
"Rule #4: /friend remove 9c3584fe963d4d579081e7e9e225763d",
"Rule #5: Play legit.",
"Rule #6: Don't type wave 3.",
"Rule #7: Don't trust shotgun.",
"Rule #8: Hit your wallshots.",
"Rule #9: Start the recording right now.",
"Rule #10: Don't s1 on wr pace.",
"Rule #11: There can be only one GOAT.",
"Rule #12: Fast T please.",
"Rule #13: Step back if insta.",
"Rule #14: No killing Teammates.",
"rule #15: No arguing because prplx is always left."
};
private int secretIndex = 0;*/
@SubscribeEvent
public void onKeyInput(InputEvent.KeyInputEvent event) {
if (Keyboard.getEventKeyState() && Minecraft.getMinecraft().currentScreen == null) {
Hotkeys hotkeys = ZombiesUtils.getInstance().getHotkeys();
if (Keyboard.getEventKey() == hotkeys.getChatMacro().getKeyCode()) {
Minecraft.getMinecraft().thePlayer.sendChatMessage(
ZombiesUtilsConfig.getChatMacro()
);
} else if (Keyboard.getEventKey() == hotkeys.getDebugger().getKeyCode()) {
for (Entity entity:Minecraft.getMinecraft().theWorld.loadedEntityList) {
System.out.println(entity.getNBTTagCompound());
}
}
}
}
}

View file

@ -1,6 +1,7 @@
package com.github.stachelbeere1248.zombiesutils.handlers; package com.github.stachelbeere1248.zombiesutils.handlers;
import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard; import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard;
import net.minecraftforge.client.event.sound.PlaySoundEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View file

@ -4,6 +4,7 @@ import com.github.stachelbeere1248.zombiesutils.ZombiesUtils;
import com.github.stachelbeere1248.zombiesutils.game.GameMode; import com.github.stachelbeere1248.zombiesutils.game.GameMode;
import com.github.stachelbeere1248.zombiesutils.timer.Timer; import com.github.stachelbeere1248.zombiesutils.timer.Timer;
import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard; import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.network.play.server.S29PacketSoundEffect; import net.minecraft.network.play.server.S29PacketSoundEffect;
import net.minecraft.network.play.server.S45PacketTitle; import net.minecraft.network.play.server.S45PacketTitle;
@ -40,18 +41,24 @@ public class MixinNetHandlerPlayClient {
ZombiesUtils.getInstance().getLogger().info("Attempting creation of new timer"); ZombiesUtils.getInstance().getLogger().info("Attempting creation of new timer");
new Timer( new Timer(
Scoreboard.getServerNumber().orElseThrow(() -> new RuntimeException("cannot figure out servernumber")), Scoreboard.getServerNumber().orElseThrow(() -> new RuntimeException("cannot figure out servernumber")),
Scoreboard.getMap().orElseThrow(() -> new RuntimeException("cannot figure out map")) Scoreboard.getMap().orElseThrow(() -> new RuntimeException("cannot figure out map")).map
); );
} else { } else { Timer timer = Timer.getInstance().get();
Timer timer = Timer.getInstance().get();
if (timer.equalsServerOrNull(Scoreboard.getServerNumber().orElse(null))) timer.split(Scoreboard.getRound());
Scoreboard.MapContainer map = Scoreboard.getMap().orElseThrow(() -> new RuntimeException("Scoreboard Error"));
if (map.pregame) {
ZombiesUtils.getInstance().getLogger().info("Attempting creation of new timer");
new Timer(
Scoreboard.getServerNumber().orElseThrow(() -> new RuntimeException("cannot figure out servernumber")),
map.map
);
} else if (timer.equalsServerOrNull(Scoreboard.getServerNumber().orElse(null))) timer.split(Scoreboard.getRound());
else { else {
ZombiesUtils.getInstance().getLogger().info("Attempting creation of new timer"); ZombiesUtils.getInstance().getLogger().info("Attempting creation of new timer");
//also kills the previous timer using the garbage collector //also kills the previous timer using the garbage collector
new Timer( new Timer(
Scoreboard.getServerNumber().orElseThrow(() -> new RuntimeException("cannot figure out servernumber")), Scoreboard.getServerNumber().orElseThrow(() -> new RuntimeException("cannot figure out servernumber")),
Scoreboard.getMap().orElseThrow(() -> new RuntimeException("cannot figure out map")) map.map
); );
} }
} }

View file

@ -20,7 +20,7 @@ public class Timer {
private final String serverNumber; private final String serverNumber;
public Category category; public Category category;
private boolean pbTracking = false; private boolean pbTracking = false;
private byte dontDupeSplitPlease = 0; private int round = 0;
/** /**
* Constructs a timer and saves it to {@link #instance}. * Constructs a timer and saves it to {@link #instance}.
@ -49,12 +49,19 @@ public class Timer {
final int gameTime = gameTime(); final int gameTime = gameTime();
final short roundTime = (short) (gameTime - passedRoundsTickSum); final short roundTime = (short) (gameTime - passedRoundsTickSum);
if (dontDupeSplitPlease == passedRound || passedRound == 0 || roundTime == 0) { if ((round == passedRound) || (passedRound == 0) || (roundTime == 0)) {
ZombiesUtils.getInstance().getLogger().debug("SPLIT CANCELLED"); ZombiesUtils.getInstance().getLogger().debug("SPLIT CANCELLED");
return; return;
} }
if (passedRound == (byte) 1) pbTracking = true;
record(passedRound, roundTime, gameTime);
passedRoundsTickSum = gameTime;
round = passedRound;
}
private void record(byte passedRound, short roundTime, int gameTime) {
if (passedRound == (byte) 1) pbTracking = true;
try { try {
RecordManager.compareSegment(passedRound, roundTime, category); RecordManager.compareSegment(passedRound, roundTime, category);
@ -64,12 +71,9 @@ public class Timer {
String.format("Split not recorded. (invalid round parsed from scoreboard: %s)", passedRound) String.format("Split not recorded. (invalid round parsed from scoreboard: %s)", passedRound)
)); ));
} }
passedRoundsTickSum = gameTime;
dontDupeSplitPlease = passedRound;
} }
private long getCurrentTotalWorldTime() { private long getCurrentTotalWorldTime() {
if (Minecraft.getMinecraft() == null) return 0; if (Minecraft.getMinecraft() == null) return 0;
if (Minecraft.getMinecraft().theWorld == null) return 0; if (Minecraft.getMinecraft().theWorld == null) return 0;
@ -97,6 +101,8 @@ public class Timer {
public static void dropInstances() { public static void dropInstances() {
instance = null; instance = null;
GameMode.drop(); GameMode.drop();
SLA.drop(); }
public int getRound() {
return round+1;
} }
} }

View file

@ -46,7 +46,7 @@ public class Category {
Timer.getInstance().ifPresent(timer -> timer.setCategory(new Category())); Timer.getInstance().ifPresent(timer -> timer.setCategory(new Category()));
} }
public static String[] getCategories() { public static String[] getCategories() {
File dir = new File("zombies"); File dir = new File("zombies"+File.separator+"splits");
if (dir.isDirectory()) return dir.list(); if (dir.isDirectory()) return dir.list();
else return new String[0]; else return new String[0];
} }

View file

@ -19,7 +19,7 @@ public class FileData{
Arrays.fill(bestSegments, (short) 0); Arrays.fill(bestSegments, (short) 0);
Arrays.fill(personalBests, 0); Arrays.fill(personalBests, 0);
} }
String getAsJsonString() { public String getAsJsonString() {
Gson gson = new Gson(); Gson gson = new Gson();
return gson.toJson(this, FileData.class); return gson.toJson(this, FileData.class);
} }

View file

@ -1,6 +1,7 @@
package com.github.stachelbeere1248.zombiesutils.timer.recorder; package com.github.stachelbeere1248.zombiesutils.timer.recorder;
import com.github.stachelbeere1248.zombiesutils.game.GameMode; import com.github.stachelbeere1248.zombiesutils.game.GameMode;
import com.github.stachelbeere1248.zombiesutils.utils.FileManager;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.io.File; import java.io.File;
@ -11,7 +12,7 @@ public class TimesFile extends File {
public TimesFile(String category, @NotNull GameMode gameMode) { public TimesFile(String category, @NotNull GameMode gameMode) {
// Game-directory -> custom category -> file named "MAP_DIFFICULTY.times" // Game-directory -> custom category -> file named "MAP_DIFFICULTY.times"
// Content encoded in StandardCharsets.UTF_16 // Content encoded in StandardCharsets.UTF_16
super("zombies" + File.separator + category,gameMode.getMap() + "_" + gameMode.getDifficulty() + ".times"); super("zombies" + File.separator + "splits" + File.separator + category,gameMode.getMap() + "_" + gameMode.getDifficulty() + ".times");
this.gameMode = gameMode; this.gameMode = gameMode;
fileData = FileManager.readOrCreate(this); fileData = FileManager.readOrCreate(this);
} }
@ -31,7 +32,7 @@ public class TimesFile extends File {
FileManager.writeDataToFile(fileData,this); FileManager.writeDataToFile(fileData,this);
} }
GameMode getGameMode() { public GameMode getGameMode() {
return gameMode; return gameMode;
} }
} }

View file

@ -1,5 +1,7 @@
package com.github.stachelbeere1248.zombiesutils.timer.recorder; package com.github.stachelbeere1248.zombiesutils.utils;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.FileData;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.TimesFile;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View file

@ -91,26 +91,40 @@ public class Scoreboard {
ZombiesUtils.getInstance().getLogger().debug("Servernumber: " + string); ZombiesUtils.getInstance().getLogger().debug("Servernumber: " + string);
return Optional.ofNullable(string); return Optional.ofNullable(string);
} }
public static Optional<Map> getMap() { public static Optional<MapContainer> getMap() {
String line; String line;
boolean pregame;
try { try {
line = lines.get(12); line = lines.get(12);
pregame = false;
} catch (Exception couldBePregame) { } catch (Exception couldBePregame) {
try { try {
line = lines.get(2); line = lines.get(2);
pregame = true;
} catch (IndexOutOfBoundsException | NullPointerException ignored) { } catch (IndexOutOfBoundsException | NullPointerException ignored) {
return Optional.empty(); return Optional.empty();
} }
} }
String mapString = MAP_PATTERN.matcher(line).replaceAll("$1"); String mapString = MAP_PATTERN.matcher(line).replaceAll("$1");
switch (mapString) { switch (mapString) {
case "Dead End": return Optional.of(Map.DEAD_END); case "Dead End": return Optional.of(new MapContainer(Map.DEAD_END,pregame));
case "Bad Blood": return Optional.of(Map.BAD_BLOOD); case "Bad Blood": return Optional.of(new MapContainer(Map.BAD_BLOOD,pregame));
case "Alien Arcadium": return Optional.of(Map.ALIEN_ARCADIUM); case "Alien Arcadium": return Optional.of(new MapContainer(Map.ALIEN_ARCADIUM,pregame));
default: return Optional.empty(); default: return Optional.empty();
} }
} }
public static boolean isZombies() { public static boolean isZombies() {
return (!"ZOMBIES".equals(title)); return (!"ZOMBIES".equals(title));
} }
public static class MapContainer {
public final Map map;
public final boolean pregame;
public MapContainer(Map map, boolean pregame) {
this.map = map;
this.pregame = pregame;
}
}
} }