1.2.4-pre5
This commit is contained in:
parent
dc51cab0df
commit
ce6e8c79b2
20 changed files with 103 additions and 28 deletions
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
package com.github.stachelbeere1248.zombiesutils.game;
|
||||
|
||||
public enum Difficulty {
|
||||
NORMAL, HARD, RIP
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
package com.github.stachelbeere1248.zombiesutils.game;
|
||||
|
||||
public enum Map {
|
||||
DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM
|
||||
}
|
|
@ -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;
|
|
@ -0,0 +1,5 @@
|
|||
package com.github.stachelbeere1248.zombiesutils.game.enums;
|
||||
|
||||
public enum Difficulty {
|
||||
NORMAL, HARD, RIP
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.github.stachelbeere1248.zombiesutils.game.enums;
|
||||
|
||||
public enum Map {
|
||||
DEAD_END, BAD_BLOOD, ALIEN_ARCADIUM, PRISON
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -150,6 +150,11 @@ public class Room {
|
|||
};
|
||||
}
|
||||
|
||||
@Contract(" -> new")
|
||||
public static Room @NotNull [] getPrison() {
|
||||
return new Room[0];
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue