diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/commands/SlaCommand.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/commands/SlaCommand.java index bfa17d1..7391aaf 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/commands/SlaCommand.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/commands/SlaCommand.java @@ -1,8 +1,8 @@ package com.github.stachelbeere1248.zombiesutils.commands; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import com.github.stachelbeere1248.zombiesutils.game.sla.QuickSLA; -import com.github.stachelbeere1248.zombiesutils.game.sla.SLA; +import com.github.stachelbeere1248.zombiesutils.game.SLA; import net.minecraft.command.*; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java index 976ff84..5d8a354 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/config/ZombiesUtilsConfig.java @@ -13,11 +13,12 @@ public class ZombiesUtilsConfig { private static Property slaToggle; private static Property slaShortener; private static Property shortSpawntime; - + private static Property sst; private static Property chatMacro; private static Property defaultCategory; private static Property waveOffset; private static Property language; + private static Property auditory; public static void load() { ZombiesUtils.getInstance().getLogger().debug("Loading config..."); @@ -69,6 +70,22 @@ public class ZombiesUtilsConfig { true, "Display spawn-time for passed waves" ); + auditory = config.get(Configuration.CATEGORY_GENERAL, + "auditory sst", + new int[]{-40, -20, 0}, + "Tick-offset to play sound", + -200, + 200, + false, + 5 + ); + sst = config.get( + Configuration.CATEGORY_GENERAL, + "SST HUD", + false, + "Enable if not using SST by Sosean" + + ); } public static short getWaveOffset() { @@ -99,6 +116,13 @@ public class ZombiesUtilsConfig { return language.getString(); } + public static int[] getAuditory() { + return auditory.getIntList(); + } + public static boolean getSST() { + return sst.getBoolean(); + } + @SubscribeEvent public void onConfigChange(ConfigChangedEvent.@NotNull OnConfigChangedEvent event) { if (event.modID.equals("zombiesutils") && event.configID == null) { diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/Difficulty.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/Difficulty.java deleted file mode 100644 index 4a061f2..0000000 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/Difficulty.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.stachelbeere1248.zombiesutils.game; - -public enum Difficulty { - NORMAL, HARD, RIP -} diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/GameMode.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/GameMode.java index 1fc76de..b7686a5 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/GameMode.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/GameMode.java @@ -1,5 +1,7 @@ package com.github.stachelbeere1248.zombiesutils.game; +import com.github.stachelbeere1248.zombiesutils.game.enums.Difficulty; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import org.jetbrains.annotations.NotNull; public class GameMode { diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/Map.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/Map.java deleted file mode 100644 index 7b38a1c..0000000 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/Map.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.github.stachelbeere1248.zombiesutils.game; - -public enum Map { - DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM -} diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/sla/SLA.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/SLA.java similarity index 96% rename from src/main/java/com/github/stachelbeere1248/zombiesutils/game/sla/SLA.java rename to src/main/java/com/github/stachelbeere1248/zombiesutils/game/SLA.java index 7dffbc1..246714b 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/sla/SLA.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/SLA.java @@ -1,7 +1,7 @@ -package com.github.stachelbeere1248.zombiesutils.game.sla; +package com.github.stachelbeere1248.zombiesutils.game; import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import com.github.stachelbeere1248.zombiesutils.game.windows.Room; import com.github.stachelbeere1248.zombiesutils.game.windows.Window; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/enums/Difficulty.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/enums/Difficulty.java new file mode 100644 index 0000000..d709f46 --- /dev/null +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/enums/Difficulty.java @@ -0,0 +1,5 @@ +package com.github.stachelbeere1248.zombiesutils.game.enums; + +public enum Difficulty { + NORMAL, HARD, RIP +} diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/enums/Map.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/enums/Map.java new file mode 100644 index 0000000..5a88482 --- /dev/null +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/enums/Map.java @@ -0,0 +1,5 @@ +package com.github.stachelbeere1248.zombiesutils.game.enums; + +public enum Map { + DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM, PRISON +} diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/sla/QuickSLA.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/sla/QuickSLA.java index 13cb49c..94af45f 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/sla/QuickSLA.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/sla/QuickSLA.java @@ -1,6 +1,7 @@ package com.github.stachelbeere1248.zombiesutils.game.sla; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.SLA; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; @SuppressWarnings("SpellCheckingInspection") public class QuickSLA { diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/waves/WaveTiming.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/waves/WaveTiming.java new file mode 100644 index 0000000..b63e853 --- /dev/null +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/waves/WaveTiming.java @@ -0,0 +1,43 @@ +package com.github.stachelbeere1248.zombiesutils.game.waves; + +import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; +import com.github.stachelbeere1248.zombiesutils.timer.Timer; +import net.minecraft.client.Minecraft; +import org.jetbrains.annotations.NotNull; + +import java.util.Arrays; + +public class WaveTiming { + public static int rl = 0; + + public static byte[] getWaves(@NotNull Timer timer) { + return Waves.get( + timer.getGameMode().getMap(), + timer.getRound() + ); + } + public static byte getLastWave(@NotNull Timer timer) { + return Waves.getLastWave( + timer.getGameMode().getMap(), + timer.getRound() + ); + } + + public static void onTick() { + Timer.getInstance().ifPresent(timer -> { + int wave = (getLastWave(timer)*20)+rl; + final int roundTime = timer.roundTime(); + final int[] auditory = ZombiesUtilsConfig.getAuditory(); + final Integer pre = roundTime-wave; + + if (Arrays.stream(auditory).anyMatch(pre::equals)) { + Minecraft.getMinecraft().thePlayer.playSound("note.pling",1,2); + } + }); + } + + public static void toggleRL() { + if (rl == 0) rl = ZombiesUtilsConfig.getWaveOffset(); + else rl = 0; + } +} diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/waves/Waves.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/waves/Waves.java index 01e0183..70a9040 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/waves/Waves.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/waves/Waves.java @@ -1,6 +1,6 @@ package com.github.stachelbeere1248.zombiesutils.game.waves; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/windows/Room.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/windows/Room.java index 4eb7579..ac1b558 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/game/windows/Room.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/game/windows/Room.java @@ -150,6 +150,11 @@ public class Room { }; } + @Contract(" -> new") + public static Room @NotNull [] getPrison() { + return new Room[0]; + } + public String getName() { return name; } diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/ChatHandler.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/ChatHandler.java index 30de6a4..ed1e3af 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/ChatHandler.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/ChatHandler.java @@ -1,6 +1,6 @@ package com.github.stachelbeere1248.zombiesutils.handlers; -import com.github.stachelbeere1248.zombiesutils.game.Difficulty; +import com.github.stachelbeere1248.zombiesutils.game.enums.Difficulty; import com.github.stachelbeere1248.zombiesutils.game.GameMode; import com.github.stachelbeere1248.zombiesutils.timer.Timer; import com.github.stachelbeere1248.zombiesutils.utils.LanguageSupport; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/RenderGameOverlayHandler.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/RenderGameOverlayHandler.java index 1a04f78..3922b9e 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/RenderGameOverlayHandler.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/handlers/RenderGameOverlayHandler.java @@ -1,7 +1,7 @@ package com.github.stachelbeere1248.zombiesutils.handlers; import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; -import com.github.stachelbeere1248.zombiesutils.game.sla.SLA; +import com.github.stachelbeere1248.zombiesutils.game.SLA; import com.github.stachelbeere1248.zombiesutils.game.waves.Waves; import com.github.stachelbeere1248.zombiesutils.game.windows.Room; import com.github.stachelbeere1248.zombiesutils.timer.Timer; @@ -94,7 +94,7 @@ public class RenderGameOverlayHandler { } private void renderSpawnTime(byte @NotNull [] waveTimes, short roundTicks) { - if (Scoreboard.isNotZombies()) return; + if (Scoreboard.isNotZombies() || !ZombiesUtilsConfig.getSST()) return; final int length = waveTimes.length + 1; int heightIndex = 0; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/Timer.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/Timer.java index a94f40f..0a40560 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/Timer.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/Timer.java @@ -3,8 +3,8 @@ package com.github.stachelbeere1248.zombiesutils.timer; import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; import com.github.stachelbeere1248.zombiesutils.game.GameMode; -import com.github.stachelbeere1248.zombiesutils.game.Map; -import com.github.stachelbeere1248.zombiesutils.game.sla.SLA; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; +import com.github.stachelbeere1248.zombiesutils.game.SLA; import com.github.stachelbeere1248.zombiesutils.handlers.Round1Correction; import com.github.stachelbeere1248.zombiesutils.timer.recorder.Category; import com.github.stachelbeere1248.zombiesutils.timer.recorder.files.GameFile; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/Category.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/Category.java index 1eab8df..30f5a23 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/Category.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/Category.java @@ -1,9 +1,9 @@ package com.github.stachelbeere1248.zombiesutils.timer.recorder; import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; -import com.github.stachelbeere1248.zombiesutils.game.Difficulty; +import com.github.stachelbeere1248.zombiesutils.game.enums.Difficulty; import com.github.stachelbeere1248.zombiesutils.game.GameMode; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import com.github.stachelbeere1248.zombiesutils.timer.Timer; import com.github.stachelbeere1248.zombiesutils.timer.recorder.files.CategoryFile; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/CategoryData.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/CategoryData.java index 680bc86..d0e02c0 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/CategoryData.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/CategoryData.java @@ -1,6 +1,6 @@ package com.github.stachelbeere1248.zombiesutils.timer.recorder.data; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import com.github.stachelbeere1248.zombiesutils.timer.recorder.ISplitsData; import com.google.gson.Gson; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/GameData.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/GameData.java index cd06368..78144dd 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/GameData.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/data/GameData.java @@ -1,6 +1,6 @@ package com.github.stachelbeere1248.zombiesutils.timer.recorder.data; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import com.github.stachelbeere1248.zombiesutils.timer.recorder.ISplitsData; import com.google.gson.Gson; import org.jetbrains.annotations.NotNull; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/files/GameFile.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/files/GameFile.java index 7853ff7..79d855e 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/files/GameFile.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/timer/recorder/files/GameFile.java @@ -2,7 +2,7 @@ package com.github.stachelbeere1248.zombiesutils.timer.recorder.files; import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import com.github.stachelbeere1248.zombiesutils.timer.recorder.FileManager; import com.github.stachelbeere1248.zombiesutils.timer.recorder.SplitsFile; import com.github.stachelbeere1248.zombiesutils.timer.recorder.data.GameData; diff --git a/src/main/java/com/github/stachelbeere1248/zombiesutils/utils/Scoreboard.java b/src/main/java/com/github/stachelbeere1248/zombiesutils/utils/Scoreboard.java index 20f2c3d..3bb2d31 100644 --- a/src/main/java/com/github/stachelbeere1248/zombiesutils/utils/Scoreboard.java +++ b/src/main/java/com/github/stachelbeere1248/zombiesutils/utils/Scoreboard.java @@ -2,7 +2,7 @@ package com.github.stachelbeere1248.zombiesutils.utils; import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; -import com.github.stachelbeere1248.zombiesutils.game.Map; +import com.github.stachelbeere1248.zombiesutils.game.enums.Map; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import net.minecraft.client.Minecraft;