diff --git a/build.gradle b/build.gradle index 9789f71..e6f3e93 100644 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ loom { mods { - "touch_grass_warning" { + "touch_grass_reminder" { sourceSet("main") } } diff --git a/gradle.properties b/gradle.properties index 9f976bc..735d625 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,6 +5,6 @@ org.gradle.parallel = true # Mod Properties version = 0.1.0 maven_group = xyz.devcomp -archives_base_name = touch_grass_warning +archives_base_name = touch_grass_reminder # Dependencies are managed at gradle/libs.versions.toml diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index feca31f..593792b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,6 @@ quilt_loader = "0.22.1-beta.2" quilted_fabric_api = "7.4.0+0.90.0-1.20.1" mixin_extras = "0.2.0" -# twelvemonkeys_imageio = "3.10.0" quilt_parsers = "0.2.1" [libraries] diff --git a/src/main/java/xyz/devcomp/touch_grass_warning/client/TouchGrassWarningClient.java b/src/main/java/xyz/devcomp/touch_grass_reminder/client/TouchGrassReminderClient.java similarity index 81% rename from src/main/java/xyz/devcomp/touch_grass_warning/client/TouchGrassWarningClient.java rename to src/main/java/xyz/devcomp/touch_grass_reminder/client/TouchGrassReminderClient.java index a090418..4dce3eb 100644 --- a/src/main/java/xyz/devcomp/touch_grass_warning/client/TouchGrassWarningClient.java +++ b/src/main/java/xyz/devcomp/touch_grass_reminder/client/TouchGrassReminderClient.java @@ -1,26 +1,27 @@ -package xyz.devcomp.touch_grass_warning.client; +package xyz.devcomp.touch_grass_reminder.client; import java.util.UUID; -import xyz.devcomp.touch_grass_warning.config.ConfigModel; -import xyz.devcomp.touch_grass_warning.utils.PlayDurationHandler; +import xyz.devcomp.touch_grass_reminder.config.ConfigModel; +import xyz.devcomp.touch_grass_reminder.utils.PlayDurationHandler; + +import net.minecraft.client.multiplayer.ServerData; import org.quiltmc.loader.api.ModContainer; import org.quiltmc.qsl.base.api.entrypoint.client.ClientModInitializer; import org.quiltmc.qsl.networking.api.client.ClientPlayConnectionEvents; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import net.minecraft.client.multiplayer.ServerData; - -public class TouchGrassWarningClient implements ClientModInitializer { - public static final Logger LOGGER = LoggerFactory.getLogger("Touch Grass Warning"); +public class TouchGrassReminderClient implements ClientModInitializer { + public static final Logger LOGGER = LoggerFactory.getLogger("Touch Grass Reminder"); private ConfigModel config = new ConfigModel(); private Thread thread; @Override public void onInitializeClient(ModContainer mod) { - LOGGER.info("Touch Grass Warning init; isEnabled={}, reminderFrequency={}h", config.isEnabled, + LOGGER.info("Touch Grass reminder init; isEnabled={}, reminderFrequency={}h", config.isEnabled, config.reminderFrequency); LOGGER.info("Registering JOIN & DISCONNECT events..."); diff --git a/src/main/java/xyz/devcomp/touch_grass_warning/config/ConfigHandler.java b/src/main/java/xyz/devcomp/touch_grass_reminder/config/ConfigHandler.java similarity index 94% rename from src/main/java/xyz/devcomp/touch_grass_warning/config/ConfigHandler.java rename to src/main/java/xyz/devcomp/touch_grass_reminder/config/ConfigHandler.java index 50e25d8..c785be9 100644 --- a/src/main/java/xyz/devcomp/touch_grass_warning/config/ConfigHandler.java +++ b/src/main/java/xyz/devcomp/touch_grass_reminder/config/ConfigHandler.java @@ -1,4 +1,4 @@ -package xyz.devcomp.touch_grass_warning.config; +package xyz.devcomp.touch_grass_reminder.config; import net.minecraft.client.gui.screens.Screen; import net.minecraft.resources.ResourceLocation; @@ -20,5 +20,4 @@ public class ConfigHandler { public Screen showGui(Screen parent) { return HANDLER.generateGui().generateScreen(parent); } - } diff --git a/src/main/java/xyz/devcomp/touch_grass_warning/config/ConfigModel.java b/src/main/java/xyz/devcomp/touch_grass_reminder/config/ConfigModel.java similarity index 58% rename from src/main/java/xyz/devcomp/touch_grass_warning/config/ConfigModel.java rename to src/main/java/xyz/devcomp/touch_grass_reminder/config/ConfigModel.java index 463c310..416a6db 100644 --- a/src/main/java/xyz/devcomp/touch_grass_warning/config/ConfigModel.java +++ b/src/main/java/xyz/devcomp/touch_grass_reminder/config/ConfigModel.java @@ -1,16 +1,16 @@ -package xyz.devcomp.touch_grass_warning.config; +package xyz.devcomp.touch_grass_reminder.config; import dev.isxander.yacl3.config.v2.api.SerialEntry; import dev.isxander.yacl3.config.v2.api.autogen.*; public class ConfigModel { @SerialEntry(comment = "Whether the mod's functionality is enabled") - @AutoGen(category = "touch_grass_warning") + @AutoGen(category = "touch_grass_reminder") @TickBox public boolean isEnabled = true; - @SerialEntry(comment = "Number of hours the warning should be displayed after") - @AutoGen(category = "touch_grass_warning") + @SerialEntry(comment = "Number of hours the reminder should be displayed after") + @AutoGen(category = "touch_grass_reminder") @IntField(min = 1) public int reminderFrequency = 24; } diff --git a/src/main/java/xyz/devcomp/touch_grass_warning/integrations/ModMenuIntegration.java b/src/main/java/xyz/devcomp/touch_grass_reminder/integrations/ModMenuIntegration.java similarity index 80% rename from src/main/java/xyz/devcomp/touch_grass_warning/integrations/ModMenuIntegration.java rename to src/main/java/xyz/devcomp/touch_grass_reminder/integrations/ModMenuIntegration.java index 7c3c112..4071ff6 100644 --- a/src/main/java/xyz/devcomp/touch_grass_warning/integrations/ModMenuIntegration.java +++ b/src/main/java/xyz/devcomp/touch_grass_reminder/integrations/ModMenuIntegration.java @@ -1,12 +1,12 @@ -package xyz.devcomp.touch_grass_warning.integrations; +package xyz.devcomp.touch_grass_reminder.integrations; + +import xyz.devcomp.touch_grass_reminder.config.ConfigHandler; import org.quiltmc.loader.api.QuiltLoader; import com.terraformersmc.modmenu.api.ConfigScreenFactory; import com.terraformersmc.modmenu.api.ModMenuApi; -import xyz.devcomp.touch_grass_warning.config.ConfigHandler; - public class ModMenuIntegration implements ModMenuApi { @Override public ConfigScreenFactory getModConfigScreenFactory() { diff --git a/src/main/java/xyz/devcomp/touch_grass_warning/utils/PlayDurationHandler.java b/src/main/java/xyz/devcomp/touch_grass_reminder/utils/PlayDurationHandler.java similarity index 71% rename from src/main/java/xyz/devcomp/touch_grass_warning/utils/PlayDurationHandler.java rename to src/main/java/xyz/devcomp/touch_grass_reminder/utils/PlayDurationHandler.java index 83083b1..e6a7e75 100644 --- a/src/main/java/xyz/devcomp/touch_grass_warning/utils/PlayDurationHandler.java +++ b/src/main/java/xyz/devcomp/touch_grass_reminder/utils/PlayDurationHandler.java @@ -1,10 +1,11 @@ -package xyz.devcomp.touch_grass_warning.utils; +package xyz.devcomp.touch_grass_reminder.utils; + +import xyz.devcomp.touch_grass_reminder.client.TouchGrassReminderClient; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.toasts.SystemToast; import net.minecraft.client.gui.components.toasts.SystemToast.SystemToastIds; import net.minecraft.network.chat.Component; -import xyz.devcomp.touch_grass_warning.client.TouchGrassWarningClient; public class PlayDurationHandler implements Runnable { Minecraft client; @@ -18,18 +19,18 @@ public PlayDurationHandler(Minecraft client, long startTime, int reminderFrequen this.reminderFrequency = reminderFrequency; this.toast = new SystemToast(SystemToastIds.TUTORIAL_HINT, - Component.translatable("touch_grass_warning.toast.name", reminderFrequency), - Component.translatable("touch_grass_warning.toast.description")); + Component.translatable("touch_grass_reminder.toast.name", reminderFrequency), + Component.translatable("touch_grass_reminder.toast.description")); } @Override public void run() { - TouchGrassWarningClient.LOGGER.info("Started playing Minecraft at: {}", this.startTime); + TouchGrassReminderClient.LOGGER.info("Started playing Minecraft at: {}", this.startTime); while (true) { if (System.currentTimeMillis() - this.startTime > this.reminderFrequency) { - TouchGrassWarningClient.LOGGER - .info("Player has spent more than 24 hours in Minecraft. Displaying warning."); + TouchGrassReminderClient.LOGGER + .info("Player has spent more than 24 hours in Minecraft. Displaying reminder."); this.client.getToasts().addToast(toast); return; diff --git a/src/main/resources/assets/touch_grass_warning/icon.png b/src/main/resources/assets/touch_grass_warning/icon.png index 33ab334..9a7122f 100644 Binary files a/src/main/resources/assets/touch_grass_warning/icon.png and b/src/main/resources/assets/touch_grass_warning/icon.png differ diff --git a/src/main/resources/assets/touch_grass_warning/lang/en_us.json b/src/main/resources/assets/touch_grass_warning/lang/en_us.json index 4a55a3b..1cc1abf 100644 --- a/src/main/resources/assets/touch_grass_warning/lang/en_us.json +++ b/src/main/resources/assets/touch_grass_warning/lang/en_us.json @@ -1,11 +1,11 @@ { - "yacl3.config.touchgrassreminder:config.category.touch_grass_warning": "Touch Grass Reminder", + "yacl3.config.touchgrassreminder:config.category.touch_grass_reminder": "Touch Grass Reminder", "yacl3.config.touchgrassreminder:config.isEnabled": "Enabled", "yacl3.config.touchgrassreminder:config.isEnabled.desc.1": "Whether most of the mod's functionality is enabled", "yacl3.config.touchgrassreminder:config.isEnabled.desc.2": "Takes effect on restart", "yacl3.config.touchgrassreminder:config.reminderFrequency": "Reminder frequency", - "yacl3.config.touchgrassreminder:config.reminderFrequency.desc.1": "After how long the warning should appear (in hours)", + "yacl3.config.touchgrassreminder:config.reminderFrequency.desc.1": "After how long the reminder should appear (in hours)", "yacl3.config.touchgrassreminder:config.reminderFrequency.desc.2": "Takes effect on restart", - "touch_grass_warning.toast.title": "You've been playing for greater than %d hours", - "touch_grass_warning.toast.description": "Excessive gaming may interfere with normal daily life" + "touch_grass_reminder.toast.title": "You've been playing for greater than %d hours", + "touch_grass_reminder.toast.description": "Excessive gaming may interfere with normal daily life" } diff --git a/src/main/resources/quilt.mod.json b/src/main/resources/quilt.mod.json index 75fac42..5007dcd 100644 --- a/src/main/resources/quilt.mod.json +++ b/src/main/resources/quilt.mod.json @@ -2,26 +2,26 @@ "schema_version": 1, "quilt_loader": { "group": "xyz.devcomp", - "id": "touch_grass_warning", + "id": "touch_grass_reminder", "version": "${version}", "metadata": { - "name": "Touch Grass Warning", - "description": "Client-side mod which warns players when they have been excessively playing Minecraft (more than 24 hours at a time).", + "name": "Touch Grass Reminder", + "description": "Client-side mod which warns players when they have been excessively playing Minecraft (by default more than 24 hours at a time).", "contributors": { "Erica Marigold": "Owner" }, "contact": { "homepage": "", - "issues": "https://github.com/CompeyDev/touch-grass-warning/issues", - "sources": "https://github.com/CompeyDev/touch-grass-warning" + "issues": "https://github.com/CompeyDev/touch-grass-reminder/issues", + "sources": "https://github.com/CompeyDev/touch-grass-reminder" }, "license": "LGPL-3.0-only", - "icon": "assets/touch_grass_warning/icon.png" + "icon": "assets/touch_grass_reminder/icon.png" }, "intermediate_mappings": "net.fabricmc:intermediary", "entrypoints": { - "client_init": "xyz.devcomp.touch_grass_warning.client.TouchGrassWarningClient", - "modmenu": "xyz.devcomp.touch_grass_warning.integrations.ModMenuIntegration" + "client_init": "xyz.devcomp.touch_grass_reminder.client.TouchGrassreminderClient", + "modmenu": "xyz.devcomp.touch_grass_reminder.integrations.ModMenuIntegration" }, "depends": [ { @@ -43,5 +43,5 @@ } ] }, - "mixin": "touch_grass_warning.mixins.json" + "mixin": "touch_grass_reminder.mixins.json" } diff --git a/src/main/resources/touch_grass_warning.mixins.json b/src/main/resources/touch_grass_warning.mixins.json deleted file mode 100644 index 50855ec..0000000 --- a/src/main/resources/touch_grass_warning.mixins.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "required": true, - "minVersion": "0.8", - "package": "xyz.devcomp.touch_grass_warning.mixin", - "compatibilityLevel": "JAVA_17", - "mixins": [], - "client": [], - "injectors": { - "defaultRequire": 1 - } -}