Upgrade to 1.18.2

This commit is contained in:
Aria 2023-02-22 02:42:55 -07:00
parent 0f250f76bb
commit 5a47daf797
7 changed files with 34 additions and 20 deletions

View file

@ -3,7 +3,7 @@
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
mc_version=1.19.2 mc_version=1.18.2
forge_version=43.2.3 forge_version=40.2.1
myversion=1.1.2.6 myversion=1.1.2.7
libz_version=1.0.3.7 libz_version=1.0.4.9

View file

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -7,11 +7,16 @@ import java.util.TimerTask;
import dev.zontreck.libzontreck.chat.ChatColor; import dev.zontreck.libzontreck.chat.ChatColor;
import dev.zontreck.libzontreck.chat.ChatColorFactory; import dev.zontreck.libzontreck.chat.ChatColorFactory;
import dev.zontreck.libzontreck.chat.HoverTip;
import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions; import dev.zontreck.libzontreck.chat.ChatColor.ColorOptions;
import dev.zontreck.mcmods.configs.WMDClientConfig; import dev.zontreck.mcmods.configs.WMDClientConfig;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.core.NonNullList; import net.minecraft.core.NonNullList;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.HoverEvent;
import net.minecraft.network.chat.MutableComponent;
import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Inventory;
@ -56,9 +61,10 @@ public class CheckInventory extends TimerTask
if(current.shouldGiveAlert()) if(current.shouldGiveAlert())
{ {
String Msg = ChatColor.doColors("!Dark_Red!!bold!You need to eat!"); String Msg = ChatColor.doColors("!Dark_Red!!bold!You need to eat!");
Minecraft.getInstance().player.displayClientMessage(Component.literal(Msg), false); Component chat = new TextComponent(Msg);
Minecraft.getInstance().player.displayClientMessage(chat, false);
SoundEvent sv = SoundEvents.WARDEN_ROAR; // It sounds like a growling stomach SoundEvent sv = SoundEvents.WOLF_GROWL; // It sounds like a growling stomach
Soundify(sv); Soundify(sv);
} }
@ -115,7 +121,14 @@ public class CheckInventory extends TimerTask
Soundify(theSound); Soundify(theSound);
Component X = Component.literal(replaced);
MutableComponent X = new TextComponent(replaced);
HoverEvent he = HoverTip.getItem(is1);
Style s = Style.EMPTY.withFont(Style.DEFAULT_FONT).withHoverEvent(he);
X=X.withStyle(s);
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

@ -4,7 +4,6 @@ import com.mojang.logging.LogUtils;
import dev.zontreck.libzontreck.chat.ChatColor; import dev.zontreck.libzontreck.chat.ChatColor;
import dev.zontreck.mcmods.configs.WMDClientConfig; import dev.zontreck.mcmods.configs.WMDClientConfig;
import dev.zontreck.mcmods.gui.HeartsRenderer;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.User; import net.minecraft.client.User;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@ -18,6 +17,8 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.event.server.ServerStartingEvent; import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.client.event.ClientPlayerNetworkEvent; import net.minecraftforge.client.event.ClientPlayerNetworkEvent;
import net.minecraftforge.client.event.ClientPlayerNetworkEvent.LoggedInEvent;
import net.minecraftforge.client.event.ClientPlayerNetworkEvent.LoggedOutEvent;
import java.util.Timer; import java.util.Timer;
@ -51,7 +52,7 @@ public class WatchMyDurability
modEventBus.addListener(this::commonSetup); modEventBus.addListener(this::commonSetup);
ModLoadingContext.get().registerConfig(Type.CLIENT, WMDClientConfig.SPEC, "watchmydurability-client.toml"); ModLoadingContext.get().registerConfig(Type.CLIENT, WMDClientConfig.SPEC, "watchmydurability-client.toml");
MinecraftForge.EVENT_BUS.register(new HeartsRenderer()); //MinecraftForge.EVENT_BUS.register(new HeartsRenderer());
// Register ourselves for server and other game events we are interested in // Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
} }
@ -97,7 +98,7 @@ public class WatchMyDurability
{ {
@SubscribeEvent @SubscribeEvent
public static void onJoin(ClientPlayerNetworkEvent.LoggingIn event){ public static void onJoin(LoggedInEvent event){
// Joined // Joined
//LOGGER.info("PLAYER LOGGED IN"); //LOGGER.info("PLAYER LOGGED IN");
LOGGER.info(WMDPrefix+": : : PLAYER LOGGED IN : : :"); LOGGER.info(WMDPrefix+": : : PLAYER LOGGED IN : : :");
@ -105,14 +106,14 @@ public class WatchMyDurability
} }
@SubscribeEvent @SubscribeEvent
public static void onLeave(ClientPlayerNetworkEvent.LoggingOut event){ public static void onLeave(LoggedOutEvent event){
//LOGGER.info("PLAYER LOGGED OUT"); //LOGGER.info("PLAYER LOGGED OUT");
LOGGER.info(WMDPrefix+": : : 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.RespawnEvent event)
{ {
LOGGER.info(WMDPrefix+": : : : PLAYER RESPAWNED OR MOVED TO A NEW WORLD : : : :"); LOGGER.info(WMDPrefix+": : : : PLAYER RESPAWNED OR MOVED TO A NEW WORLD : : : :");

View file

@ -12,7 +12,7 @@ public class WMDClientConfig {
public static ForgeConfigSpec.ConfigValue<List<Integer>> alertPercents; public static ForgeConfigSpec.ConfigValue<List<Integer>> alertPercents;
public static ForgeConfigSpec.ConfigValue<List<String>> alertMessages; public static ForgeConfigSpec.ConfigValue<List<String>> alertMessages;
public static ForgeConfigSpec.ConfigValue<Integer> TimerVal; public static ForgeConfigSpec.ConfigValue<Integer> TimerVal;
public static ForgeConfigSpec.ConfigValue<Boolean> EnableExtraHearts; //public static ForgeConfigSpec.ConfigValue<Boolean> EnableExtraHearts;
public static ForgeConfigSpec.ConfigValue<Boolean> EnableHealthAlert; public static ForgeConfigSpec.ConfigValue<Boolean> EnableHealthAlert;
static{ static{
@ -33,7 +33,7 @@ public class WMDClientConfig {
BUILDER.pop(); BUILDER.pop();
BUILDER.push("General"); BUILDER.push("General");
EnableExtraHearts = BUILDER.comment("Whether to enable the extra hearts rendering").define("compress_hearts", false); //EnableExtraHearts = BUILDER.comment("Whether to enable the extra hearts rendering").define("compress_hearts", false);
EnableHealthAlert = BUILDER.comment("The following was added for a friend. If you need reminders to eat in order to heal, turn the below option on").define("watchMyHunger", false); EnableHealthAlert = BUILDER.comment("The following was added for a friend. If you need reminders to eat in order to heal, turn the below option on").define("watchMyHunger", false);

View file

@ -6,7 +6,7 @@
# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml
modLoader="javafml" #mandatory modLoader="javafml" #mandatory
# A version range to match for said mod loader - for regular FML @Mod it will be the forge version # A version range to match for said mod loader - for regular FML @Mod it will be the forge version
loaderVersion="[43,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. loaderVersion="[40,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions.
# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties.
# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here.
license="GPL-v2" license="GPL-v2"
@ -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.2.6" #mandatory version="1.1.2.7" #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/
@ -55,7 +55,7 @@ Edit the config file to customize the alerts
# Does this dependency have to exist - if not, ordering below must be specified # Does this dependency have to exist - if not, ordering below must be specified
mandatory=true #mandatory mandatory=true #mandatory
# The version range of the dependency # The version range of the dependency
versionRange="[43,)" #mandatory versionRange="[40,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
ordering="NONE" ordering="NONE"
# Side this dependency is applied on - BOTH, CLIENT or SERVER # Side this dependency is applied on - BOTH, CLIENT or SERVER
@ -65,12 +65,12 @@ Edit the config file to customize the alerts
modId="minecraft" modId="minecraft"
mandatory=true mandatory=true
# This version range declares a minimum of the current minecraft version up to but not including the next major version # This version range declares a minimum of the current minecraft version up to but not including the next major version
versionRange="[1.19.2,1.20)" versionRange="[1.18.2,1.19)"
ordering="NONE" ordering="NONE"
side="CLIENT" side="CLIENT"
[[dependencies.watchmydurability]] [[dependencies.watchmydurability]]
modId="libzontreck" modId="libzontreck"
mandatory=true mandatory=true
versionRange="[1.0.3.5,)" versionRange="[1.0.4.9,1.0.5.0)"
ordering="NONE" ordering="NONE"
side="CLIENT" side="CLIENT"