1.2.4-pre5

This commit is contained in:
Stachelbeere1248 2024-02-13 21:45:23 +01:00
parent dc51cab0df
commit ce6e8c79b2
Signed by: Stachelbeere1248
SSH key fingerprint: SHA256:IozEKdw2dB8TZxkpPdMxcWSoWTIMwoLaCcZJ1AJnY2o
20 changed files with 103 additions and 28 deletions

View file

@ -1,8 +1,8 @@
package com.github.stachelbeere1248.zombiesutils.commands; 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.QuickSLA;
import com.github.stachelbeere1248.zombiesutils.game.sla.SLA; import com.github.stachelbeere1248.zombiesutils.game.SLA;
import net.minecraft.command.*; import net.minecraft.command.*;
import net.minecraft.util.BlockPos; import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;

View file

@ -13,11 +13,12 @@ public class ZombiesUtilsConfig {
private static Property slaToggle; private static Property slaToggle;
private static Property slaShortener; private static Property slaShortener;
private static Property shortSpawntime; private static Property shortSpawntime;
private static Property sst;
private static Property chatMacro; private static Property chatMacro;
private static Property defaultCategory; private static Property defaultCategory;
private static Property waveOffset; private static Property waveOffset;
private static Property language; private static Property language;
private static Property auditory;
public static void load() { public static void load() {
ZombiesUtils.getInstance().getLogger().debug("Loading config..."); ZombiesUtils.getInstance().getLogger().debug("Loading config...");
@ -69,6 +70,22 @@ public class ZombiesUtilsConfig {
true, true,
"Display spawn-time for passed waves" "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() { public static short getWaveOffset() {
@ -99,6 +116,13 @@ public class ZombiesUtilsConfig {
return language.getString(); return language.getString();
} }
public static int[] getAuditory() {
return auditory.getIntList();
}
public static boolean getSST() {
return sst.getBoolean();
}
@SubscribeEvent @SubscribeEvent
public void onConfigChange(ConfigChangedEvent.@NotNull OnConfigChangedEvent event) { public void onConfigChange(ConfigChangedEvent.@NotNull OnConfigChangedEvent event) {
if (event.modID.equals("zombiesutils") && event.configID == null) { if (event.modID.equals("zombiesutils") && event.configID == null) {

View file

@ -1,5 +0,0 @@
package com.github.stachelbeere1248.zombiesutils.game;
public enum Difficulty {
NORMAL, HARD, RIP
}

View file

@ -1,5 +1,7 @@
package com.github.stachelbeere1248.zombiesutils.game; 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; import org.jetbrains.annotations.NotNull;
public class GameMode { public class GameMode {

View file

@ -1,5 +0,0 @@
package com.github.stachelbeere1248.zombiesutils.game;
public enum Map {
DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM
}

View file

@ -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.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.Room;
import com.github.stachelbeere1248.zombiesutils.game.windows.Window; import com.github.stachelbeere1248.zombiesutils.game.windows.Window;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;

View file

@ -0,0 +1,5 @@
package com.github.stachelbeere1248.zombiesutils.game.enums;
public enum Difficulty {
NORMAL, HARD, RIP
}

View file

@ -0,0 +1,5 @@
package com.github.stachelbeere1248.zombiesutils.game.enums;
public enum Map {
DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM, PRISON
}

View file

@ -1,6 +1,7 @@
package com.github.stachelbeere1248.zombiesutils.game.sla; 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") @SuppressWarnings("SpellCheckingInspection")
public class QuickSLA { public class QuickSLA {

View file

@ -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;
}
}

View file

@ -1,6 +1,6 @@
package com.github.stachelbeere1248.zombiesutils.game.waves; 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.Contract;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View file

@ -150,6 +150,11 @@ public class Room {
}; };
} }
@Contract(" -> new")
public static Room @NotNull [] getPrison() {
return new Room[0];
}
public String getName() { public String getName() {
return name; return name;
} }

View file

@ -1,6 +1,6 @@
package com.github.stachelbeere1248.zombiesutils.handlers; 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.game.GameMode;
import com.github.stachelbeere1248.zombiesutils.timer.Timer; import com.github.stachelbeere1248.zombiesutils.timer.Timer;
import com.github.stachelbeere1248.zombiesutils.utils.LanguageSupport; import com.github.stachelbeere1248.zombiesutils.utils.LanguageSupport;

View file

@ -1,7 +1,7 @@
package com.github.stachelbeere1248.zombiesutils.handlers; package com.github.stachelbeere1248.zombiesutils.handlers;
import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; 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.waves.Waves;
import com.github.stachelbeere1248.zombiesutils.game.windows.Room; import com.github.stachelbeere1248.zombiesutils.game.windows.Room;
import com.github.stachelbeere1248.zombiesutils.timer.Timer; import com.github.stachelbeere1248.zombiesutils.timer.Timer;
@ -94,7 +94,7 @@ public class RenderGameOverlayHandler {
} }
private void renderSpawnTime(byte @NotNull [] waveTimes, short roundTicks) { private void renderSpawnTime(byte @NotNull [] waveTimes, short roundTicks) {
if (Scoreboard.isNotZombies()) return; if (Scoreboard.isNotZombies() || !ZombiesUtilsConfig.getSST()) return;
final int length = waveTimes.length + 1; final int length = waveTimes.length + 1;
int heightIndex = 0; int heightIndex = 0;

View file

@ -3,8 +3,8 @@ package com.github.stachelbeere1248.zombiesutils.timer;
import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; import com.github.stachelbeere1248.zombiesutils.ZombiesUtils;
import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig;
import com.github.stachelbeere1248.zombiesutils.game.GameMode; 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.game.sla.SLA; import com.github.stachelbeere1248.zombiesutils.game.SLA;
import com.github.stachelbeere1248.zombiesutils.handlers.Round1Correction; import com.github.stachelbeere1248.zombiesutils.handlers.Round1Correction;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.Category; import com.github.stachelbeere1248.zombiesutils.timer.recorder.Category;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.files.GameFile; import com.github.stachelbeere1248.zombiesutils.timer.recorder.files.GameFile;

View file

@ -1,9 +1,9 @@
package com.github.stachelbeere1248.zombiesutils.timer.recorder; package com.github.stachelbeere1248.zombiesutils.timer.recorder;
import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; 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.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.Timer;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.files.CategoryFile; import com.github.stachelbeere1248.zombiesutils.timer.recorder.files.CategoryFile;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View file

@ -1,6 +1,6 @@
package com.github.stachelbeere1248.zombiesutils.timer.recorder.data; 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.github.stachelbeere1248.zombiesutils.timer.recorder.ISplitsData;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View file

@ -1,6 +1,6 @@
package com.github.stachelbeere1248.zombiesutils.timer.recorder.data; 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.github.stachelbeere1248.zombiesutils.timer.recorder.ISplitsData;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;

View file

@ -2,7 +2,7 @@ package com.github.stachelbeere1248.zombiesutils.timer.recorder.files;
import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; 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.FileManager;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.SplitsFile; import com.github.stachelbeere1248.zombiesutils.timer.recorder.SplitsFile;
import com.github.stachelbeere1248.zombiesutils.timer.recorder.data.GameData; import com.github.stachelbeere1248.zombiesutils.timer.recorder.data.GameData;

View file

@ -2,7 +2,7 @@ package com.github.stachelbeere1248.zombiesutils.utils;
import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; import com.github.stachelbeere1248.zombiesutils.ZombiesUtils;
import com.github.stachelbeere1248.zombiesutils.config.ZombiesUtilsConfig; 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.Iterables;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;