From 5a70c8f072dc52eb3478d127e1ea89e2ce71e67c Mon Sep 17 00:00:00 2001 From: Zontreck Date: Thu, 13 Oct 2022 21:32:10 -0700 Subject: [PATCH] Update to 1.1.1.2 --- build.gradle | 9 +++++---- gradle.properties | 3 ++- .../java/dev/zontreck/mcmods/CheckInventory.java | 11 +++++++---- .../dev/zontreck/mcmods/WatchMyDurability.java | 14 +++++++------- src/main/resources/META-INF/mods.toml | 2 +- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/build.gradle b/build.gradle index 95806d2..68f4e8f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } version = "${myversion}" -group = 'dev.zontreck.mcmods' // http://maven.apache.org/guides/mini/guide-naming-conventions.html +group = 'dev.zontreck' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'WatchMyDurability' // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. @@ -135,9 +135,10 @@ dependencies { // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}" - implementation fg.deobf("dev.zontreck:libzontreck:1.0.0.1:dev") - runtimeOnly fg.deobf("dev.zontreck:libzontreck:1.0.0.1") - compileOnly fg.deobf("dev.zontreck:libzontreck:1.0.0.1:dev") + implementation fg.deobf("dev.zontreck:libzontreck:${libz_version}:dev") + runtimeOnly fg.deobf("dev.zontreck:libzontreck:${libz_version}") + compileOnly fg.deobf("dev.zontreck:libzontreck:${libz_version}:dev") + // Real mod deobf dependency examples - these get remapped to your current mappings // compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency diff --git a/gradle.properties b/gradle.properties index 7897f3b..001f6dc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,5 @@ org.gradle.daemon=false mc_version=1.19.2 forge_version=43.1.16 -myversion = 1.1.1.1 \ No newline at end of file +myversion=1.1.1.2 +libz_version=1.0.0.2 \ No newline at end of file diff --git a/src/main/java/dev/zontreck/mcmods/CheckInventory.java b/src/main/java/dev/zontreck/mcmods/CheckInventory.java index 99eec29..30481b6 100644 --- a/src/main/java/dev/zontreck/mcmods/CheckInventory.java +++ b/src/main/java/dev/zontreck/mcmods/CheckInventory.java @@ -55,13 +55,15 @@ public class CheckInventory extends TimerTask // Good to proceed if(current.shouldGiveAlert()) { - - Minecraft.getInstance().player.displayClientMessage(Component.literal(ChatColorFactory.MakeBuilder().set(ColorOptions.Dark_Red).set(ColorOptions.Bold).toString()+"You need to eat!"), false); + String Msg = ChatColor.doColors("!Dark_Red!!bold!You need to eat!"); + Minecraft.getInstance().player.displayClientMessage(Component.literal(Msg), false); - SoundEvent sv = SoundEvents.WARDEN_ROAR; + SoundEvent sv = SoundEvents.WARDEN_ROAR; // It sounds like a growling stomach Soundify(sv); } + WatchMyDurability.LastHealth=current; + } public void PushItems(String type, List stack) @@ -111,7 +113,8 @@ public class CheckInventory extends TimerTask SoundEvent theSound = SoundEvents.ITEM_BREAK; Soundify(theSound); - + + Component X = Component.literal(replaced); Minecraft.getInstance().player.displayClientMessage(X, false); break; // Rule applies, break out of this loop, move to next item. diff --git a/src/main/java/dev/zontreck/mcmods/WatchMyDurability.java b/src/main/java/dev/zontreck/mcmods/WatchMyDurability.java index e4ee4b2..5b09c46 100644 --- a/src/main/java/dev/zontreck/mcmods/WatchMyDurability.java +++ b/src/main/java/dev/zontreck/mcmods/WatchMyDurability.java @@ -2,8 +2,7 @@ package dev.zontreck.mcmods; import com.mojang.logging.LogUtils; -import dev.zontreck.libzontreck.chat.ChatColorFactory; -import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions; +import dev.zontreck.libzontreck.chat.ChatColor; import dev.zontreck.mcmods.configs.WMDClientConfig; import dev.zontreck.mcmods.gui.HeartsRenderer; import net.minecraft.client.Minecraft; @@ -44,7 +43,8 @@ public class WatchMyDurability public WatchMyDurability() { - WMDPrefix = ChatColorFactory.MakeBuilder().set(ColorOptions.Dark_Gray).toString() + "[" + ChatColorFactory.MakeBuilder().set(ColorOptions.Dark_Green) + "WMD" + ChatColorFactory.MakeBuilder().set(ColorOptions.Dark_Gray) + "]"; + WatchMyDurability.WMDPrefix = ChatColor.doColors("!Dark_Gray![!Bold!!Dark_Green!WMD!Reset!!Dark_Gray!]!reset!"); + IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); // Register the commonSetup method for modloading @@ -79,7 +79,7 @@ public class WatchMyDurability @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { - LOGGER.info(": : : CLIENT SETUP : : :"); + LOGGER.info(WMDPrefix+": : : CLIENT SETUP : : :"); // Some client setup code //LOGGER.info("HELLO FROM CLIENT SETUP"); //LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName()); @@ -100,21 +100,21 @@ public class WatchMyDurability public static void onJoin(ClientPlayerNetworkEvent.LoggingIn event){ // Joined //LOGGER.info("PLAYER LOGGED IN"); - LOGGER.info(": : : PLAYER LOGGED IN : : :"); + LOGGER.info(WMDPrefix+": : : PLAYER LOGGED IN : : :"); WatchMyDurability.isInGame=true; } @SubscribeEvent public static void onLeave(ClientPlayerNetworkEvent.LoggingOut event){ //LOGGER.info("PLAYER LOGGED OUT"); - LOGGER.info(": : : PLAYER LOGGED OUT : : :"); + LOGGER.info(WMDPrefix+": : : PLAYER LOGGED OUT : : :"); WatchMyDurability.isInGame=false; } @SubscribeEvent public static void onClone(ClientPlayerNetworkEvent.Clone event) { - LOGGER.info(": : : : PLAYER RESPAWNED OR MOVED TO A NEW WORLD : : : :"); + LOGGER.info(WMDPrefix+": : : : PLAYER RESPAWNED OR MOVED TO A NEW WORLD : : : :"); } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 5ce24e2..4fcb982 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -19,7 +19,7 @@ modId="watchmydurability" #mandatory # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it # ${file.jarVersion} will substitute the value of the Implementation-Version as read from the mod's JAR file metadata # see the associated build.gradle script for how to populate this completely automatically during a build -version="1.1.1.1" #mandatory +version="1.1.1.2" #mandatory # A display name for the mod displayName="Watch My Durability" #mandatory # A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/