Update to 1.1.1.2

This commit is contained in:
Zontreck 2022-10-13 21:32:10 -07:00
parent 9507923f86
commit 5a70c8f072
5 changed files with 22 additions and 17 deletions

View file

@ -5,7 +5,7 @@ plugins {
} }
version = "${myversion}" 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' archivesBaseName = 'WatchMyDurability'
// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. // 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. // 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}" minecraft "net.minecraftforge:forge:${mc_version}-${forge_version}"
implementation 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:1.0.0.1") runtimeOnly fg.deobf("dev.zontreck:libzontreck:${libz_version}")
compileOnly fg.deobf("dev.zontreck:libzontreck:1.0.0.1:dev") compileOnly fg.deobf("dev.zontreck:libzontreck:${libz_version}:dev")
// Real mod deobf dependency examples - these get remapped to your current mappings // 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 // 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 // runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency

View file

@ -5,4 +5,5 @@ org.gradle.daemon=false
mc_version=1.19.2 mc_version=1.19.2
forge_version=43.1.16 forge_version=43.1.16
myversion = 1.1.1.1 myversion=1.1.1.2
libz_version=1.0.0.2

View file

@ -55,13 +55,15 @@ public class CheckInventory extends TimerTask
// Good to proceed // Good to proceed
if(current.shouldGiveAlert()) if(current.shouldGiveAlert())
{ {
String Msg = ChatColor.doColors("!Dark_Red!!bold!You need to eat!");
Minecraft.getInstance().player.displayClientMessage(Component.literal(Msg), false);
Minecraft.getInstance().player.displayClientMessage(Component.literal(ChatColorFactory.MakeBuilder().set(ColorOptions.Dark_Red).set(ColorOptions.Bold).toString()+"You need to eat!"), false); SoundEvent sv = SoundEvents.WARDEN_ROAR; // It sounds like a growling stomach
SoundEvent sv = SoundEvents.WARDEN_ROAR;
Soundify(sv); Soundify(sv);
} }
WatchMyDurability.LastHealth=current;
} }
public void PushItems(String type, List<ItemStack> stack) public void PushItems(String type, List<ItemStack> stack)
@ -112,6 +114,7 @@ public class CheckInventory extends TimerTask
SoundEvent theSound = SoundEvents.ITEM_BREAK; SoundEvent theSound = SoundEvents.ITEM_BREAK;
Soundify(theSound); Soundify(theSound);
Component X = Component.literal(replaced); Component X = Component.literal(replaced);
Minecraft.getInstance().player.displayClientMessage(X, false); Minecraft.getInstance().player.displayClientMessage(X, false);
break; // Rule applies, break out of this loop, move to next item. break; // Rule applies, break out of this loop, move to next item.

View file

@ -2,8 +2,7 @@ package dev.zontreck.mcmods;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import dev.zontreck.libzontreck.chat.ChatColorFactory; import dev.zontreck.libzontreck.chat.ChatColor;
import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions;
import dev.zontreck.mcmods.configs.WMDClientConfig; import dev.zontreck.mcmods.configs.WMDClientConfig;
import dev.zontreck.mcmods.gui.HeartsRenderer; import dev.zontreck.mcmods.gui.HeartsRenderer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
@ -44,7 +43,8 @@ public class WatchMyDurability
public 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(); IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
// Register the commonSetup method for modloading // Register the commonSetup method for modloading
@ -79,7 +79,7 @@ public class WatchMyDurability
@SubscribeEvent @SubscribeEvent
public static void onClientSetup(FMLClientSetupEvent event) public static void onClientSetup(FMLClientSetupEvent event)
{ {
LOGGER.info(": : : CLIENT SETUP : : :"); LOGGER.info(WMDPrefix+": : : CLIENT SETUP : : :");
// Some client setup code // Some client setup code
//LOGGER.info("HELLO FROM CLIENT SETUP"); //LOGGER.info("HELLO FROM CLIENT SETUP");
//LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName()); //LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName());
@ -100,21 +100,21 @@ public class WatchMyDurability
public static void onJoin(ClientPlayerNetworkEvent.LoggingIn event){ public static void onJoin(ClientPlayerNetworkEvent.LoggingIn event){
// Joined // Joined
//LOGGER.info("PLAYER LOGGED IN"); //LOGGER.info("PLAYER LOGGED IN");
LOGGER.info(": : : PLAYER LOGGED IN : : :"); LOGGER.info(WMDPrefix+": : : PLAYER LOGGED IN : : :");
WatchMyDurability.isInGame=true; WatchMyDurability.isInGame=true;
} }
@SubscribeEvent @SubscribeEvent
public static void onLeave(ClientPlayerNetworkEvent.LoggingOut event){ public static void onLeave(ClientPlayerNetworkEvent.LoggingOut event){
//LOGGER.info("PLAYER LOGGED OUT"); //LOGGER.info("PLAYER LOGGED OUT");
LOGGER.info(": : : PLAYER LOGGED OUT : : :"); LOGGER.info(WMDPrefix+": : : PLAYER LOGGED OUT : : :");
WatchMyDurability.isInGame=false; WatchMyDurability.isInGame=false;
} }
@SubscribeEvent @SubscribeEvent
public static void onClone(ClientPlayerNetworkEvent.Clone event) 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 : : : :");
} }
} }

View file

@ -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 # 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 # ${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 # 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 # A display name for the mod
displayName="Watch My Durability" #mandatory 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/ # A URL to query for updates for this mod. See the JSON update specification https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/