diff --git a/README.md b/README.md index 3cea151..b347c7a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,43 @@ EAA_MOD =============== +This MOD is created by the "Eggwars Am Abend" (EAA) Squad, to increase fun playing minecraft by avoiding hacking/idiotic players and providing some useful tools. +This mod is 100% clientside and does not interact with the server you are playing on. + +## Features +Following a list of features this mod provides +### TAG +It's basically a report system. + +Users are able to mark other players with a set of tags. As example as Hacker/Friend/Goodplayer and so on. +In addition, the tag gets weighted by a scale from 0 to 10. + +Tagged players are shown at the player overview (TAB) including their recent tag with grade. +Other commands like playercheck/lobbycheck also use tag data. + +### Ping as Number +Heavily inspired by this cool project, check it out! + +https://www.curseforge.com/minecraft/mc-mods/better-ping-display-fabric + +### Echo +uhm ... yeh ... it echos ... uhm ... you + +## Commands +All mod commands start with a double slash (`//`), so they don't get confused with other commands + +* `//tag ` + * Tags player with chosen tag and grade. On success a toast is shown. +* `//lobby` + * Checks if any negative tagged players (Hacker/Idiot/Noob) are in the current lobby. +* `//check ` + * shows detailed information about player including past playernames and tags. +* `//echo ` + * reply with text +* `//reload` + * reloads cashed players. Useful when playing in a team and someone tagged another player. Otherwise the tag would not appear till next game start. + + + ## Settings Mod needs a file in modfolder called settings.properties containing following values: @@ -9,4 +47,10 @@ url=mysql:/// user= password= db_name= -``` \ No newline at end of file +``` + +A working sample config is provided in the config folder, setup with a readonly user of the developers Database. + +## Database +Database-Model and SQL-Starterscript can be found in the config/database folder. +The Mod itself does not create the needed Database structure. The user has to init the Database by itself. \ No newline at end of file diff --git a/src/main/resources/datenbank/datenbank_shema.mwb b/config/database/datenbank_shema.mwb similarity index 100% rename from src/main/resources/datenbank/datenbank_shema.mwb rename to config/database/datenbank_shema.mwb diff --git a/src/main/resources/datenbank/datenbank_shema.png b/config/database/datenbank_shema.png similarity index 100% rename from src/main/resources/datenbank/datenbank_shema.png rename to config/database/datenbank_shema.png diff --git a/src/main/resources/datenbank/datenbank_shema.sql b/config/database/datenbank_shema.sql similarity index 100% rename from src/main/resources/datenbank/datenbank_shema.sql rename to config/database/datenbank_shema.sql diff --git a/config/settings.properties b/config/settings.properties new file mode 100644 index 0000000..8bc9426 --- /dev/null +++ b/config/settings.properties @@ -0,0 +1,4 @@ +url=mysql://mysql2f88.netcup.net/ +user=k85020_EAA_MOD_RO +password=EeChf3dfZmwDgMo4rYSFj9bC9i5EaFkKtXfw5F7hPSQyKTZfNv3qougR3jn99ehUiRAgyr9ypLQJUyQhDQAdLf35ymst5sXf34Zo +db_name=k85020_EAA_MOD \ No newline at end of file diff --git a/src/main/java/net/saltymc/eaa/commands/TagCommand.java b/src/main/java/net/saltymc/eaa/commands/TagCommand.java index c02d634..fc3dfe2 100644 --- a/src/main/java/net/saltymc/eaa/commands/TagCommand.java +++ b/src/main/java/net/saltymc/eaa/commands/TagCommand.java @@ -35,15 +35,17 @@ public class TagCommand extends EaaModCommand{ .then( argument("player", StringArgumentType.word()) .suggests((ctx, builder) -> EntityArgumentType.player().listSuggestions(ctx, builder)) - .then(argument("tag", StringArgumentType.word()) - .suggests(((context, builder) -> { - for (DB_Tag.Type tag : DB_Tag.Type.values()) - builder.suggest(tag.name()); - return builder.buildFuture(); - })) - .then( - argument("grade", IntegerArgumentType.integer(0,10)) - .executes(this) - ))); + .then( + argument("tag", StringArgumentType.word()) + .suggests(((context, builder) -> { + for (DB_Tag.Type tag : DB_Tag.Type.values()) + builder.suggest(tag.name()); + return builder.buildFuture(); + })) + .then( + argument("grade", IntegerArgumentType.integer(0,10)) + .suggests((ctx, builder) -> IntegerArgumentType.integer(0,10).listSuggestions(ctx, builder)) + .executes(this) + ))); } } diff --git a/src/main/java/net/saltymc/eaa/function/LobbyFunction.java b/src/main/java/net/saltymc/eaa/function/LobbyFunction.java index a427705..9d026af 100644 --- a/src/main/java/net/saltymc/eaa/function/LobbyFunction.java +++ b/src/main/java/net/saltymc/eaa/function/LobbyFunction.java @@ -38,7 +38,7 @@ public class LobbyFunction { if (type == DB_Tag.Type.HACKER){ dangerLvl = 2; break; - } else if (type == DB_Tag.Type.IDIOT){ + } else if (type == DB_Tag.Type.IDIOT || type == DB_Tag.Type.NOOB){ dangerLvl = 1; } } @@ -49,7 +49,7 @@ public class LobbyFunction { SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.WORLD_BACKUP, Text.of("OKAY!"), Text.of("No Hackers found")); break; case 1: - SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.TUTORIAL_HINT, Text.of("MEH!"), Text.of("There is an Idiot!")); + SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.TUTORIAL_HINT, Text.of("MEH!"), Text.of("There is an Idiot or Noob!")); break; case 2: SystemToast.add(source.getClient().getToastManager(), SystemToast.Type.WORLD_ACCESS_FAILURE, Text.of("ALARM!"), Text.of("There is a Hacker!")); diff --git a/src/main/java/net/saltymc/eaa/util/database/DB_Tag.java b/src/main/java/net/saltymc/eaa/util/database/DB_Tag.java index 05dbf8a..8b94394 100644 --- a/src/main/java/net/saltymc/eaa/util/database/DB_Tag.java +++ b/src/main/java/net/saltymc/eaa/util/database/DB_Tag.java @@ -1,7 +1,5 @@ package net.saltymc.eaa.util.database; -import net.minecraft.util.Formatting; - import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException;