Compare commits

..

No commits in common. "forge_1.8.9-master" and "v1.3.7-PRE_2" have entirely different histories.

25 changed files with 119 additions and 166 deletions

View file

@ -1,80 +1,56 @@
# zombies-utils # zombies-utils
##### Download the latest release [here](https://github.com/Stachelbeere1248/zombies-utils/releases/latest)
##### Go to release page [here](https://git.stachel.xyz/Stachelbeere1248/zombies-utils/releases)
Hello, I am currently working on this mod. More features will come. For now it has: Hello, I am currently working on this mod. More features will come. For now it has:
- An accurate timer + Automatic splitting - An accurate timer + Automatic splitting
- Tracking of splits & segment PBs (with custom categories) - Tracking of splits & segment PBs (with custom categories)
- SLA hud - SLA hud
- A chat macro - A chat macro
- Spawn-times HUD: visual, auditory, RL-mode - Spawn-times HUD: visual, auditory, RL-mode
- Player Visibility - Player Visibility
#### Disclaimers #### Disclaimers
- If you are using a Hypixel language other than the selected one the mod may not work entirely. Check config. - If you are using a Hypixel language other than the selected one the mod may not work entirely. Check config.
## For Users ## For Users
The timer automatically splits every round. The PB/Segment recorder automatically distinguishes maps and difficulties, but not player count.
The timer automatically splits every round. The PB/Segment recorder automatically distinguishes maps and difficulties,
but not player count.
### Config ### Config
- `Language`: The selected Hypixel language. Currently supports EN,FR,DE. - `Language`: The selected Hypixel language. Currently supports EN,FR,DE.
- ###### Timer: - ###### Timer:
- `Default Category`: The record-category to be selected when starting the game. - `Default Category`: The record-category to be selected when starting the game.
- `PB Announcements`: Whether to show **\*\*\*NEW PERSONAL BEST\*\*\*** on PB in summaries. - `PB Announcements`: Whether to show **\*\*\*NEW PERSONAL BEST\*\*\*** on PB in summaries.
- ###### SST: - ###### SST:
- `Enabled`: Enables / disables this feature. - `Enabled`: Enables / disables this feature.
- `Auditory`: A List of tick offsets that a sound should be played. Default (-40, -20, 0) means 2s and 1s in - `Auditory`: A List of tick offsets that a sound should be played. Default (-40, -20, 0) means 2s and 1s in advance, as well as on spawn.
advance, as well as on spawn. - `RL pre-timing`: During RL mode, how much SST times sohuld be offsetted. Defaults to 1.4s earlier. Affects HUD as well as auditory.
- `RL pre-timing`: During RL mode, how much SST times sohuld be offsetted. Defaults to 1.4s earlier. Affects HUD as - `Truncate`: Whether to show passed rounds in the HUD.
well as auditory.
- `Truncate`: Whether to show passed rounds in the HUD.
- ###### SLA: - ###### SLA:
- `Enabled`: Whether the SLA HUD should automatically be shown when starting a game. - `Enabled`: Whether the SLA HUD should automatically be shown when starting a game.
- `Truncate`: Whether inactive windows and rooms should be shown. - `Truncate`: Whether inactive windows and rooms should be shown.
- ###### Player Visibility: - ###### Player Visibility:
- `Enabled`: Whether to enable PlayerVisibility by default. - `Enabled`: Whether to enable PlayerVisibility by default.
- `Range`: The range within which players are hidden while enabled. - `Range`: The range within which players are hidden while enabled.
- `Macro Message`: The Message to be sent when pressing the Chat Macro Key. Do NOT use "§" as symbol. - `Macro Message`: The Message to be sent when pressing the Chat Macro Key. Do NOT use "§" as symbol.
- `CPS Counter`: A simple CPS Counter which shows the amount of clicks within the last 20 gameticks. - `CPS Counter`: A simple CPS Counter which shows the amount of clicks within the last 20 gameticks.
### Commands ### Commands
- /category \<name> - Switches to the category called name. All recorded times are bound to its category. Tabcomplete suggests already existing categories, but you can insert a new (clean) one as well.
- /category \<name> - Switches to the category called name. All recorded times are bound to its category. Tabcomplete - Examples:
suggests already existing categories, but you can insert a new (clean) one as well. - /category pistol_only
- Examples: - /category no_doors_solo
- /category pistol_only - note: you do NOT need to make your own categories to seperate difficulties or map
- /category no_doors_solo
- note: you do NOT need to make your own categories to seperate difficulties or map
- /sla \<off|map|quick|rotate|mirror|offset> - /sla \<off|map|quick|rotate|mirror|offset>
- /sla off - Disables the SLA hud - /sla off - Disables the SLA hud
- /sla map \<de|bb|aa|p> - forcefully set the map - /sla map \<de|bb|aa|p> - forcefully set the map
- /sla quick \<mogi_a|ghxula|ghxula-garden> - /sla quick \<mogi_a|ghxula|ghxula-garden>
- useless for most players: - useless for most players:
- /sla rotate - rotates all windows around the axis (0,y,0) - /sla rotate - rotates all windows around the axis (0,y,0)
- /sla mirror \<x|z> - mirrors all windows along the plane (0,y,z) or (x,y,0) - /sla mirror \<x|z> - mirrors all windows along the plane (0,y,z) or (x,y,0)
- /sla offset \<x> \<y> \<z> - set an offset, allowing you to use sla on map-recreations, such as housings - /sla offset \<x> \<y> \<z> - set an offset, allowing you to use sla on map-recreations, such as housings
- /zombiesutils \<timer> - /zombiesutils \<timer>
- /zombiesutils timer \<kill|split> - /zombiesutils timer \<kill|split>
- /zombiesutils timer kill - Stops the running timer completely - /zombiesutils timer kill - Stops the running timer completely
- /zombiesutils timer split \<round> - Splits as if \<round> was passed, not recommended to use as it might - /zombiesutils timer split \<round> - Splits as if \<round> was passed, not recommended to use as it might create impossible PBs.
create impossible PBs.
- /qz \<de|bb|aa|p> - sends you to a new game of Dead End, Bad Blood, Alien Arcadium or Prison - /qz \<de|bb|aa|p> - sends you to a new game of Dead End, Bad Blood, Alien Arcadium or Prison
### Hotkeys ### Hotkeys
- Chat Macro: Sends the message specified in the config. - Chat Macro: Sends the message specified in the config.
- RL Mode: Toggles usage of the rocket launcher mode spawn-time offset. - RL Mode: Toggles usage of the rocket launcher mode spawn-time offset.
- Player Visibility: Toggles whether to show players that are within a 4 block radius. - Player Visibility: Toggles whether to show players that are within a 4 block radius.
### Extra ### Extra
- Managing split-categories: In your game directory (aka `.minecraft`) is a folder called `zombies` which contains the folder `splits`. You can simply rename or delete the folders inside `splits`, they represent your categories. You can also edit your splits, the data is stored as a list of ticks inside the `MAP_DIFFICULTY.times` files, a simple text editor (such as Notepad on Windows) should be able to edit it (UTF-16 encoded text). The other subfolder, runs, logs all the splits for every run you play.
- Managing split-categories: In your game directory (aka `.minecraft`) is a folder called `zombies` which contains the
folder `splits`. You can simply rename or delete the folders inside `splits`, they represent your categories. You can
also edit your splits, the data is stored as a list of ticks inside the `MAP_DIFFICULTY.times` files, a simple text
editor (such as Notepad on Windows) should be able to edit it (UTF-16 encoded text). The other subfolder, runs, logs
all the splits for every run you play.

View file

@ -1,6 +1,6 @@
loom.platform=forge loom.platform=forge
org.gradle.jvmargs=-Xmx2g 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.3.7 version = 1.3.7-PRE_2

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN"> <Configuration status="WARN">
<!-- Filter out Hypixel scoreboard and sound errors --> <!-- Filter out Hypixel scoreboard and sound errors -->
<RegexFilter regex="Error executing task.*|Unable to play unknown soundEvent.*" onMatch="DENY" <RegexFilter regex="Error executing task.*|Unable to play unknown soundEvent.*" onMatch="DENY" onMismatch="NEUTRAL"/>
onMismatch="NEUTRAL"/>
</Configuration> </Configuration>

View file

@ -19,7 +19,7 @@ pluginManagement {
} }
plugins { plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.6.0") id("org.gradle.toolchains.foojay-resolver-convention") version("0.6.0")
} }

View file

@ -1,8 +1,8 @@
package com.github.stachelbeere1248.zombiesutils.commands; package com.github.stachelbeere1248.zombiesutils.commands;
import com.github.stachelbeere1248.zombiesutils.game.windows.SLA;
import com.github.stachelbeere1248.zombiesutils.game.enums.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.windows.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

@ -68,7 +68,8 @@ public class ZombiesUtilsCommand extends CommandBase {
default: default:
return Collections.emptyList(); return Collections.emptyList();
} }
} else if (args.length == 3) { }
else if (args.length == 3) {
switch (args[0]) { switch (args[0]) {
case "timer": case "timer":
switch (args[1]) { switch (args[1]) {

View file

@ -41,7 +41,6 @@ public class Hotkeys {
public KeyBinding getRlSpawn() { public KeyBinding getRlSpawn() {
return rlSpawn; return rlSpawn;
} }
public KeyBinding getPlayerVisiblity() { public KeyBinding getPlayerVisiblity() {
return playerVisiblity; return playerVisiblity;
} }

View file

@ -158,7 +158,6 @@ public class ZombiesUtilsConfig {
new CustomConfigElement("PB announcements", announcePB) new CustomConfigElement("PB announcements", announcePB)
); );
} }
private List<IConfigElement> getPlayerVisElements() { private List<IConfigElement> getPlayerVisElements() {
return Arrays.asList( return Arrays.asList(
new CustomConfigElement("Enabled", playerVis), new CustomConfigElement("Enabled", playerVis),
@ -219,15 +218,12 @@ public class ZombiesUtilsConfig {
public boolean getCpsToggle() { public boolean getCpsToggle() {
return cpsCounter.getBoolean(); return cpsCounter.getBoolean();
} }
public boolean getAnnouncePB() { public boolean getAnnouncePB() {
return announcePB.getBoolean(); return announcePB.getBoolean();
} }
public boolean getPlayerVis() { public boolean getPlayerVis() {
return playerVis.getBoolean(); return playerVis.getBoolean();
} }
public int getPlayerVisRange() { public int getPlayerVisRange() {
return playerVisRange.getInt(); return playerVisRange.getInt();
} }

View file

@ -8,7 +8,6 @@ import org.jetbrains.annotations.NotNull;
public class GameData { public class GameData {
private final Round[][] roundData; private final Round[][] roundData;
public GameData() { public GameData() {
roundData = new Round[10][]; roundData = new Round[10][];
roundData[0] = readFromFile("data/rounds/DEAD_END_NORMAL.json"); roundData[0] = readFromFile("data/rounds/DEAD_END_NORMAL.json");
@ -26,25 +25,25 @@ public class GameData {
public Round getRound(@NotNull GameMode gameMode, int round) { public Round getRound(@NotNull GameMode gameMode, int round) {
switch (gameMode) { switch (gameMode) {
case DEAD_END: case DEAD_END:
return roundData[0][round - 1]; return roundData[0][round-1];
case DEAD_END_HARD: case DEAD_END_HARD:
return roundData[1][round - 1]; return roundData[1][round-1];
case DEAD_END_RIP: case DEAD_END_RIP:
return roundData[2][round - 1]; return roundData[2][round-1];
case BAD_BLOOD: case BAD_BLOOD:
return roundData[3][round - 1]; return roundData[3][round-1];
case BAD_BLOOD_HARD: case BAD_BLOOD_HARD:
return roundData[4][round - 1]; return roundData[4][round-1];
case BAD_BLOOD_RIP: case BAD_BLOOD_RIP:
return roundData[5][round - 1]; return roundData[5][round-1];
case ALIEN_ARCADIUM: case ALIEN_ARCADIUM:
return roundData[6][round - 1]; return roundData[6][round-1];
case PRISON: case PRISON:
return roundData[7][round - 1]; return roundData[7][round-1];
case PRISON_HARD: case PRISON_HARD:
return roundData[8][round - 1]; return roundData[8][round-1];
case PRISON_RIP: case PRISON_RIP:
return roundData[9][round - 1]; return roundData[9][round-1];
default: default:
throw new IllegalStateException("Invalid GameMode: " + gameMode); throw new IllegalStateException("Invalid GameMode: " + gameMode);
} }

View file

@ -12,28 +12,11 @@ public enum GameMode {
PRISON(Map.PRISON, Difficulty.NORMAL), PRISON_HARD(Map.PRISON, Difficulty.HARD), PRISON_RIP(Map.PRISON, Difficulty.RIP); PRISON(Map.PRISON, Difficulty.NORMAL), PRISON_HARD(Map.PRISON, Difficulty.HARD), PRISON_RIP(Map.PRISON, Difficulty.RIP);
private final Map map; private final Map map;
private final Difficulty difficulty; private final Difficulty difficulty;
GameMode(final @NotNull Map map, final @NotNull Difficulty difficulty) { GameMode(final @NotNull Map map, final @NotNull Difficulty difficulty) {
this.map = map; this.map = map;
this.difficulty = difficulty; this.difficulty = difficulty;
} }
@Contract(pure = true)
public static GameMode getNormalForMap(final @NotNull Map map) {
switch (map) {
case DEAD_END:
return DEAD_END;
case BAD_BLOOD:
return BAD_BLOOD;
case ALIEN_ARCADIUM:
return ALIEN_ARCADIUM;
case PRISON:
return PRISON;
default:
throw new IllegalStateException("Unexpected value: " + map);
}
}
public Map getMap() { public Map getMap() {
return this.map; return this.map;
} }
@ -41,7 +24,6 @@ public enum GameMode {
public Difficulty getDifficulty() { public Difficulty getDifficulty() {
return this.difficulty; return this.difficulty;
} }
public GameMode appliedDifficulty(final Difficulty difficulty) { public GameMode appliedDifficulty(final Difficulty difficulty) {
switch (this.map) { switch (this.map) {
case DEAD_END: case DEAD_END:
@ -77,8 +59,23 @@ public enum GameMode {
throw new IllegalStateException("Invalid Map: " + this.map); throw new IllegalStateException("Invalid Map: " + this.map);
} }
} }
public boolean isMap(Map map) { public boolean isMap(Map map) {
return this.getMap() == map; return this.getMap() == map;
} }
@Contract(pure = true)
public static GameMode getNormalForMap(final @NotNull Map map) {
switch (map) {
case DEAD_END:
return DEAD_END;
case BAD_BLOOD:
return BAD_BLOOD;
case ALIEN_ARCADIUM:
return ALIEN_ARCADIUM;
case PRISON:
return PRISON;
default:
throw new IllegalStateException("Unexpected value: " + map);
}
}
} }

View file

@ -14,7 +14,7 @@ public enum Map {
public static Optional<Map> getMap() { public static Optional<Map> getMap() {
World world = Minecraft.getMinecraft().theWorld; World world = Minecraft.getMinecraft().theWorld;
BlockPos pos = new BlockPos(44, 71, 0); BlockPos pos = new BlockPos(44,71,0);
if (!world.isBlockLoaded(pos) || Scoreboard.isNotZombies()) return Optional.empty(); if (!world.isBlockLoaded(pos) || Scoreboard.isNotZombies()) return Optional.empty();
Block block = world.getBlockState(pos).getBlock(); Block block = world.getBlockState(pos).getBlock();

View file

@ -1,7 +1,7 @@
package com.github.stachelbeere1248.zombiesutils.game.sla; package com.github.stachelbeere1248.zombiesutils.game.sla;
import com.github.stachelbeere1248.zombiesutils.game.enums.Map;
import com.github.stachelbeere1248.zombiesutils.game.windows.SLA; import com.github.stachelbeere1248.zombiesutils.game.windows.SLA;
import com.github.stachelbeere1248.zombiesutils.game.enums.Map;
@SuppressWarnings("SpellCheckingInspection") @SuppressWarnings("SpellCheckingInspection")
public class QuickSLA { public class QuickSLA {

View file

@ -1,37 +1,39 @@
package com.github.stachelbeere1248.zombiesutils.game.waves; package com.github.stachelbeere1248.zombiesutils.game.waves;
import java.util.stream.IntStream;
public enum Prefix { public enum Prefix {
BOSS(0xCC5555, "B", 0x7A3333), BOSS(0xCC5555, "B"),
BLAZES(0xEFB61F, "BL", 0x8F6D0F), BLAZES(0xEFB61F, "BL"),
SLIME(0x88FF88, "S", 0x51A951), SLIME(0x88FF88,"S"),
HBM(0x2A415F, "HBM", 0x193241), HBM(0x2A415F, "HBM"),
WITHER_SKELETON(0x888888, "WS", 0x515151), WITHER_SKELETON(0x888888, "WS"),
OLD_ONE(0x55AA55, "O1", 0x336633), OLD_ONE(0x55AA55, "O1"),
GIANT(0x00FFFF, "G", 0x009999), GIANT(0x00FFFF,"G"),
POLICE(0x16537E, "P", 0x0E324D), POLICE(0x16537E,"P"),
CELL(0xFF8234, "C", 0x99501F), CELL(0xFF8234,"C"),
WINDOW(0xAAAAAA, "W", 0x666666); WINDOW(0xAAAAAA,"W");
private final int color; private final int color;
private final int fadedColor;
private final String prefix; private final String prefix;
Prefix(final int color, final String prefix, final int fadedColor) { Prefix(final int color, final String prefix) {
this.color = color; this.color = color;
this.prefix = prefix; this.prefix = prefix;
this.fadedColor = fadedColor;
} }
public int getColor() { public int getColor() {
return color; return color;
} }
public String getPrefix() { public String getPrefix() {
return prefix; return prefix;
} }
public int getFadedColor() { public int getFadedColor(final int fact, final int div) {
return fadedColor; final int normalColor = this.getColor();
final int B = normalColor % 0xFF;
final int G = (normalColor - B) % (0xFF * 0xFF);
final int R = (normalColor - (B + G));
return IntStream.of(R, G, B).map(i -> (i * fact) / div).sum();
} }
} }

View file

@ -1,5 +1,8 @@
package com.github.stachelbeere1248.zombiesutils.game.waves; package com.github.stachelbeere1248.zombiesutils.game.waves;
import java.util.Arrays;
import java.util.stream.Collectors;
public class Round { public class Round {
private final Wave[] waves; private final Wave[] waves;

View file

@ -9,10 +9,9 @@ public class Wave {
this.ticks = ticks; this.ticks = ticks;
this.prefixes = prefixes; this.prefixes = prefixes;
} }
public Wave(final short ticks) { public Wave(final short ticks) {
this.ticks = ticks; this.ticks = ticks;
this.prefixes = new Prefix[]{ Prefix.WINDOW }; this.prefixes = new Prefix[]{Prefix.WINDOW};
} }
public short getTime() { public short getTime() {

View file

@ -8,7 +8,6 @@ import java.util.Arrays;
public class WaveTiming { public class WaveTiming {
public static int rl = 0; public static int rl = 0;
public static void onTick() { public static void onTick() {
if (Scoreboard.isNotZombies()) return; if (Scoreboard.isNotZombies()) return;
ZombiesUtils.getInstance().getGameManager().getGame().ifPresent( ZombiesUtils.getInstance().getGameManager().getGame().ifPresent(

View file

@ -2,9 +2,10 @@ package com.github.stachelbeere1248.zombiesutils.handlers;
import com.github.stachelbeere1248.zombiesutils.ZombiesUtils; import com.github.stachelbeere1248.zombiesutils.ZombiesUtils;
import com.github.stachelbeere1248.zombiesutils.game.waves.Prefix; import com.github.stachelbeere1248.zombiesutils.game.waves.Prefix;
import com.github.stachelbeere1248.zombiesutils.game.waves.Round;
import com.github.stachelbeere1248.zombiesutils.game.waves.Wave; import com.github.stachelbeere1248.zombiesutils.game.waves.Wave;
import com.github.stachelbeere1248.zombiesutils.game.windows.Room;
import com.github.stachelbeere1248.zombiesutils.game.windows.SLA; import com.github.stachelbeere1248.zombiesutils.game.windows.SLA;
import com.github.stachelbeere1248.zombiesutils.game.windows.Room;
import com.github.stachelbeere1248.zombiesutils.timer.Game; import com.github.stachelbeere1248.zombiesutils.timer.Game;
import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard; import com.github.stachelbeere1248.zombiesutils.utils.Scoreboard;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -51,8 +52,7 @@ public class RenderGameOverlayHandler {
} }
); );
if (!Minecraft.getMinecraft().gameSettings.showDebugInfo) if (!Minecraft.getMinecraft().gameSettings.showDebugInfo) SLA.getInstance().ifPresent(sla -> renderSla(sla.getRooms()));
SLA.getInstance().ifPresent(sla -> renderSla(sla.getRooms()));
if (ZombiesUtils.getInstance().getConfig().getCpsToggle()) renderCPS(); if (ZombiesUtils.getInstance().getConfig().getCpsToggle()) renderCPS();
} }
@ -87,7 +87,6 @@ public class RenderGameOverlayHandler {
y++; y++;
} }
} }
private void renderSpawnTime(final Game game) { private void renderSpawnTime(final Game game) {
if (!ZombiesUtils.getInstance().getConfig().getSST() || Scoreboard.isNotZombies()) return; if (!ZombiesUtils.getInstance().getConfig().getSST() || Scoreboard.isNotZombies()) return;
final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
@ -124,7 +123,7 @@ public class RenderGameOverlayHandler {
prefixString, prefixString,
screenWidth - width, screenWidth - width,
screenHeight - fontRenderer.FONT_HEIGHT * (length - heightIndex), screenHeight - fontRenderer.FONT_HEIGHT * (length - heightIndex),
faded ? prefix.getFadedColor() : prefix.getColor() faded ? prefix.getFadedColor(3,5) : prefix.getColor()
); );
} }
if (!faded) color = 0xAAAAAA; if (!faded) color = 0xAAAAAA;
@ -133,7 +132,7 @@ public class RenderGameOverlayHandler {
} }
public void renderCPS() { public void renderCPS() {
final String cps = String.format("%2d", getClicks()); final String cps = String.format("%2d", getClicks());
final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
final int screenWidth = scaledResolution.getScaledWidth(); final int screenWidth = scaledResolution.getScaledWidth();

View file

@ -27,7 +27,6 @@ public class RenderPlayerHandler {
final int range = ZombiesUtils.getInstance().getConfig().getPlayerVisRange(); final int range = ZombiesUtils.getInstance().getConfig().getPlayerVisRange();
return playerOther.squareDistanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) <= range * range; return playerOther.squareDistanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) <= range * range;
} }
public void togglePlayerVisibility() { public void togglePlayerVisibility() {
this.visible = !this.visible; this.visible = !this.visible;
final String s; final String s;

View file

@ -39,8 +39,8 @@ public class MixinNetHandlerPlayClient {
if (!( if (!(
soundEffect.equals("mob.wither.spawn") soundEffect.equals("mob.wither.spawn")
|| (soundEffect.equals("mob.guardian.curse") || (soundEffect.equals("mob.guardian.curse")
&& !zombies_utils$alienUfoOpened) && !zombies_utils$alienUfoOpened)
)) return; )) return;
zombies_utils$alienUfoOpened = soundEffect.equals("mob.guardian.curse"); zombies_utils$alienUfoOpened = soundEffect.equals("mob.guardian.curse");
@ -59,8 +59,8 @@ public class MixinNetHandlerPlayClient {
if (Scoreboard.isNotZombies()) return; if (Scoreboard.isNotZombies()) return;
final String message = packet.getMessage().getUnformattedText().trim(); final String message = packet.getMessage().getUnformattedText().trim();
String serverNumber; String serverNumber;
serverNumber = Scoreboard.getServerNumber().orElse(""); serverNumber = Scoreboard.getServerNumber().orElse("");
if (LanguageSupport.isWin(message)) ZombiesUtils.getInstance().getGameManager().endGame(serverNumber, true); if (LanguageSupport.isWin(message)) ZombiesUtils.getInstance().getGameManager().endGame(serverNumber,true);
if (LanguageSupport.isLoss(message)) ZombiesUtils.getInstance().getGameManager().endGame(serverNumber, false); if (LanguageSupport.isLoss(message)) ZombiesUtils.getInstance().getGameManager().endGame(serverNumber, false);
} }

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.game.GameMode; import com.github.stachelbeere1248.zombiesutils.game.GameMode;
import com.github.stachelbeere1248.zombiesutils.game.enums.Difficulty; import com.github.stachelbeere1248.zombiesutils.game.enums.Difficulty;
import com.github.stachelbeere1248.zombiesutils.game.enums.Map;
import com.github.stachelbeere1248.zombiesutils.game.windows.SLA; import com.github.stachelbeere1248.zombiesutils.game.windows.SLA;
import com.github.stachelbeere1248.zombiesutils.game.enums.Map;
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.CategoryFile; import com.github.stachelbeere1248.zombiesutils.timer.recorder.files.CategoryFile;
@ -35,7 +35,6 @@ public class Game {
MinecraftForge.EVENT_BUS.register(new Round1Correction(this.timer, serverNumber)); MinecraftForge.EVENT_BUS.register(new Round1Correction(this.timer, serverNumber));
if (ZombiesUtils.getInstance().getConfig().isSlaToggled()) SLA.instance = new SLA(map); if (ZombiesUtils.getInstance().getConfig().isSlaToggled()) SLA.instance = new SLA(map);
} }
public Game(@NotNull final Map map, final String serverNumber, final int round) { public Game(@NotNull final Map map, final String serverNumber, final int round) {
this.gameMode = GameMode.getNormalForMap(map); this.gameMode = GameMode.getNormalForMap(map);
this.timer = new Timer(); this.timer = new Timer();
@ -50,21 +49,17 @@ public class Game {
} }
public Timer getTimer() { public Timer getTimer() {
return this.timer; return this.timer;
} }
public void setCategory(Category category) { public void setCategory(Category category) {
this.category = category; this.category = category;
} }
public void changeDifficulty(final Difficulty difficulty) { public void changeDifficulty(final Difficulty difficulty) {
this.gameMode = this.gameMode.appliedDifficulty(difficulty); this.gameMode = this.gameMode.appliedDifficulty(difficulty);
} }
public int getRound() { public int getRound() {
return round; return round;
} }
public GameMode getGameMode() { public GameMode getGameMode() {
return gameMode; return gameMode;
} }
@ -83,7 +78,6 @@ public class Game {
this.timer.split(); this.timer.split();
this.round = round + 1; this.round = round + 1;
} }
public void helicopter() { public void helicopter() {
if (!gameMode.isMap(Map.PRISON)) { if (!gameMode.isMap(Map.PRISON)) {
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§cEscaping without playing prison???")); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§cEscaping without playing prison???"));
@ -95,9 +89,9 @@ public class Game {
} }
private void record() { private void record() {
this.compareSegment(); this.compareSegment();
if (this.roundOneRecorded) this.compareBest(); if (this.roundOneRecorded) this.compareBest();
this.gameFile.setSegment(this.round, this.timer.getRoundTime()); this.gameFile.setSegment(this.round, this.timer.getRoundTime());
} }
public void compareSegment() throws IndexOutOfBoundsException { public void compareSegment() throws IndexOutOfBoundsException {

View file

@ -29,14 +29,14 @@ public class GameManager {
final Game game = GAMES.get(serverNumber); final Game game = GAMES.get(serverNumber);
if (isWin) { if (isWin) {
switch (game.getGameMode().getMap()) { switch (game.getGameMode().getMap()) {
case DEAD_END: case DEAD_END:
case BAD_BLOOD: case BAD_BLOOD:
case PRISON: case PRISON:
game.pass(30); game.pass(30);
break; break;
case ALIEN_ARCADIUM: case ALIEN_ARCADIUM:
game.pass(105); game.pass(105);
break; break;
} }
} }
GAMES.remove(serverNumber); GAMES.remove(serverNumber);

View file

@ -15,14 +15,13 @@ public class RecordMessageSender {
private final String deltaString; private final String deltaString;
private final String timeString; private final String timeString;
private String copyString; private String copyString;
public RecordMessageSender(final String categoryName, final int round, final int newTime, final int oldTime) { public RecordMessageSender(final String categoryName, final int round, final int newTime, final int oldTime) {
this.recordMessage = new StringBuilder( this.recordMessage = new StringBuilder(
"§l§a▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n§e Category: §d" + categoryName "§l§a▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n§e Category: §d" + categoryName
); );
this.newTime = newTime; this.newTime = newTime;
this.oldTime = oldTime; this.oldTime = oldTime;
this.deltaString = oldTime != 0 ? " " + formattedDelta(newTime, oldTime) : ""; this.deltaString = oldTime != 0 ? " " + formattedDelta(newTime, oldTime) : "";
this.timeString = formattedTime(newTime); this.timeString = formattedTime(newTime);
this.round = round; this.round = round;
} }
@ -30,8 +29,8 @@ public class RecordMessageSender {
public void sendRecordMessage() { public void sendRecordMessage() {
final ChatComponentText message = new ChatComponentText( final ChatComponentText message = new ChatComponentText(
this.recordMessage this.recordMessage
.append("\n§l§a▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬") .append("\n§l§a▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬")
.toString() .toString()
); );
message.setChatStyle(new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, this.copyString))); message.setChatStyle(new ChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, this.copyString)));
Minecraft.getMinecraft().thePlayer.addChatMessage(message); Minecraft.getMinecraft().thePlayer.addChatMessage(message);
@ -70,7 +69,6 @@ public class RecordMessageSender {
String.format("Round %d took %s!", round, timeString) : String.format("Round %d took %s!", round, timeString) :
String.format("Round %d took %s (%s)!", round, timeString, deltaString); String.format("Round %d took %s (%s)!", round, timeString, deltaString);
} }
public void helicopterSplit() { public void helicopterSplit() {
final String announcement = newTime < oldTime && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ? final String announcement = newTime < oldTime && ZombiesUtils.getInstance().getConfig().getAnnouncePB() ?
"\n§e§l***§6§l NEW PERSONAL BEST! §e§l***" : ""; "\n§e§l***§6§l NEW PERSONAL BEST! §e§l***" : "";
@ -84,7 +82,6 @@ public class RecordMessageSender {
String.format("Helicopter called at %s!", timeString) : String.format("Helicopter called at %s!", timeString) :
String.format("Helicopter called at %s (%s)!", timeString, deltaString); String.format("Helicopter called at %s (%s)!", timeString, deltaString);
} }
@Contract(pure = true) @Contract(pure = true)
private String formattedTime(int time) { private String formattedTime(int time) {
time *= 50; time *= 50;
@ -95,7 +92,6 @@ public class RecordMessageSender {
(time % 100) / 10 (time % 100) / 10
); );
} }
@Contract(pure = true) @Contract(pure = true)
private String formattedDelta(int newTime, int oldTime) { private String formattedDelta(int newTime, int oldTime) {
final double delta = (double) (newTime - oldTime) / 20; final double delta = (double) (newTime - oldTime) / 20;

View file

@ -14,11 +14,9 @@ public class Timer {
public void correctStartTick() { public void correctStartTick() {
this.startTick = this.getCurrentTick() - 200; this.startTick = this.getCurrentTick() - 200;
} }
void split() { void split() {
this.roundStart = this.getGameTime(); this.roundStart = this.getGameTime();
} }
public int getGameTime() { public int getGameTime() {
return (int) (getCurrentTick() - startTick); return (int) (getCurrentTick() - startTick);
} }

View file

@ -51,7 +51,6 @@ public class LanguageSupport {
}; };
return Arrays.stream(words).anyMatch(input::contains); return Arrays.stream(words).anyMatch(input::contains);
} }
public static boolean isHelicopterIncoming(@NotNull String input) { public static boolean isHelicopterIncoming(@NotNull String input) {
final String[] words = { final String[] words = {
"The Helicopter is on its way! Hold out for 120 more seconds!" "The Helicopter is on its way! Hold out for 120 more seconds!"
@ -71,7 +70,6 @@ public class LanguageSupport {
throw new IllegalStateException("Unexpected value: " + language); throw new IllegalStateException("Unexpected value: " + language);
} }
} }
public static String[] getLanguages() { public static String[] getLanguages() {
return LANGUAGES; return LANGUAGES;
} }

View file

@ -1,13 +1,12 @@
{ {
"homepage": "https://github.com/Stachelbeere1248/zombies-utils/releases", "homepage": "https://github.com/Stachelbeere1248/zombies-utils/releases",
"promos": { "promos": {
"1.8.9-latest": "1.3.7", "1.8.9-latest" : "1.3.7-PRE_2",
"1.8.9-recommended": "1.3.7" "1.8.9-recommended" : "1.3.6"
}, },
"1.8.9": { "1.8.9" : {
"1.3.6": "SST Prefixes, added update checker url", "1.3.6" : "SST Prefixes, added update checker url",
"1.3.7-PRE_1": "patch: difficiluty detection", "1.3.7-PRE_1" : "patch: difficiluty detection",
"1.3.7-PRE_2": "fix instant crash", "1.3.7-PRE_2" : "fix instant crash"
"1.3.7": "mark release, fix faded prefix colors"
} }
} }