Added a warning

This commit is contained in:
Semmieboy YT 2022-06-02 20:27:28 +02:00
parent f01a6a40e3
commit 21beaa1f27
3 changed files with 9 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import java.util.HashMap;
public class SongPlayer implements ClientTickEvents.StartWorldTick {
private static final Box BOX = new Box(0, 0, 0, 1, 1, 1);
private static boolean warned;
public boolean running;
public Song song;
@ -34,7 +35,11 @@ public class SongPlayer implements ClientTickEvents.StartWorldTick {
private int tuneDelay = 5;
public void start(Song song) {
// TODO: 5/31/2022 State that this mod is bannable once each session
if (!Main.config.hideWarning && !warned) {
MinecraftClient.getInstance().inGameHud.getChatHud().addMessage(Text.translatable("disc_jockey.warning").formatted(Formatting.BOLD, Formatting.RED));
warned = true;
return;
}
if (running) stop();
this.song = song;
Main.TICK_LISTENERS.add(this);

View File

@ -18,6 +18,7 @@
"disc_jockey.song_not_found": " Song '%s' does not exist",
"disc_jockey.not_playing": "Not playing any song",
"disc_jockey.stopped_playing": "Stopped playing '%s'",
"disc_jockey.warning": "WARNING!!! This mod is very likely to get false flagged as hacks, please contact a server administrator before using this mod! (You can disable this warning in the mod settings)",
"key.category.disc_jockey": "Disc Jockey",
"disc_jockey.key_bind.open_screen": "Open song selection screen",
"text.autoconfig.disc_jockey.title": "Disc Jockey",

View File

@ -26,6 +26,7 @@
],
"depends": {
"fabric": "*",
"minecraft": ">=1.19-beta.5 <=1.19-rc.1"
"minecraft": ">=1.19-beta.5 <=1.19-rc.1",
"modmenu": "*"
}
}