Push update for 1.19.4
This commit is contained in:
parent
9f8b5582f1
commit
574faa7b8d
6 changed files with 37 additions and 19 deletions
|
@ -3,7 +3,7 @@ HOW TO BUILD
|
|||
|
||||
On your platform of choice
|
||||
```
|
||||
gradlew clean jar
|
||||
gradlew clean build
|
||||
```
|
||||
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ repositories {
|
|||
// dir 'libs'
|
||||
// }
|
||||
maven {
|
||||
name = "ZNI Creations"
|
||||
name = "Aria's Creations"
|
||||
url = "https://maven.zontreck.dev"
|
||||
}
|
||||
}
|
||||
|
@ -187,3 +187,7 @@ publishing {
|
|||
tasks.withType(JavaCompile).configureEach {
|
||||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives jar
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
mc_version=1.18.2
|
||||
forge_version=40.2.1
|
||||
myversion=1.1.3.0306230216
|
||||
libz_version=1.0.5.0306230154
|
||||
mc_version=1.19.4
|
||||
forge_version=45.0.46
|
||||
myversion=1.1.4.0422230321
|
||||
libz_version=1.0.7.0422230320
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import dev.zontreck.ariaslib.util.DelayedExecutorService;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.libzontreck.chat.ChatColorFactory;
|
||||
import dev.zontreck.libzontreck.chat.HoverTip;
|
||||
|
@ -16,21 +17,26 @@ 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.SoundEvents;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
||||
public class CheckInventory extends TimerTask
|
||||
{
|
||||
public class CheckInventory implements Runnable {
|
||||
private static final CheckInventory inst = new CheckInventory();
|
||||
|
||||
public static CheckInventory getInstance(){
|
||||
return inst;
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
try {
|
||||
|
||||
if(!WatchMyDurability.isInGame)return;
|
||||
|
||||
DelayedExecutorService.getInstance().schedule(this,
|
||||
WMDClientConfig.TimerVal.get());
|
||||
//WatchMyDurability.LOGGER.info("TICKING CHECK INVENTORY EVENT");
|
||||
// Get the player inventory
|
||||
Inventory inv = Minecraft.getInstance().player.getInventory();
|
||||
|
@ -61,10 +67,10 @@ public class CheckInventory extends TimerTask
|
|||
if(current.shouldGiveAlert())
|
||||
{
|
||||
String Msg = ChatColor.doColors("!Dark_Red!!bold!You need to eat!");
|
||||
Component chat = new TextComponent(Msg);
|
||||
Component chat = Component.literal(Msg);
|
||||
Minecraft.getInstance().player.displayClientMessage(chat, false);
|
||||
|
||||
SoundEvent sv = SoundEvents.WOLF_GROWL; // It sounds like a growling stomach
|
||||
SoundEvent sv = SoundEvents.WARDEN_ROAR; // It sounds like a growling stomach
|
||||
Soundify(sv);
|
||||
}
|
||||
|
||||
|
@ -122,7 +128,7 @@ public class CheckInventory extends TimerTask
|
|||
|
||||
|
||||
|
||||
MutableComponent X = new TextComponent(replaced);
|
||||
MutableComponent X = Component.literal(replaced);
|
||||
|
||||
HoverEvent he = HoverTip.getItem(is1);
|
||||
Style s = Style.EMPTY.withFont(Style.DEFAULT_FONT).withHoverEvent(he);
|
||||
|
|
|
@ -2,11 +2,13 @@ package dev.zontreck.mcmods;
|
|||
|
||||
import com.mojang.logging.LogUtils;
|
||||
|
||||
import dev.zontreck.ariaslib.util.DelayedExecutorService;
|
||||
import dev.zontreck.libzontreck.chat.ChatColor;
|
||||
import dev.zontreck.mcmods.configs.WMDClientConfig;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.User;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
|
@ -17,11 +19,10 @@ import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
|
|||
import net.minecraftforge.event.server.ServerStartingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
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 net.minecraftforge.network.NetworkEvent;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// The value here should match an entry in the META-INF/mods.toml file
|
||||
|
@ -85,8 +86,13 @@ public class WatchMyDurability
|
|||
//LOGGER.info("HELLO FROM CLIENT SETUP");
|
||||
//LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName());
|
||||
WatchMyDurability.CurrentUser = Minecraft.getInstance().getUser();
|
||||
|
||||
DelayedExecutorService.getInstance().schedule(CheckInventory.getInstance(),
|
||||
WMDClientConfig.TimerVal.get());
|
||||
|
||||
time.schedule(new CheckInventory(), WMDClientConfig.TimerVal.get()*1000, WMDClientConfig.TimerVal.get()*1000);
|
||||
//time.schedule(new CheckInventory(),
|
||||
//WMDClientConfig.TimerVal.get()*1000,
|
||||
//WMDClientConfig.TimerVal.get()*1000);
|
||||
|
||||
ItemRegistry.Initialize();
|
||||
|
||||
|
@ -98,22 +104,24 @@ public class WatchMyDurability
|
|||
{
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onJoin(LoggedInEvent event){
|
||||
public static void onJoin(ClientPlayerNetworkEvent.LoggingIn event){
|
||||
// Joined
|
||||
//LOGGER.info("PLAYER LOGGED IN");
|
||||
LOGGER.info(WMDPrefix+": : : PLAYER LOGGED IN : : :");
|
||||
WatchMyDurability.isInGame=true;
|
||||
|
||||
DelayedExecutorService.getInstance().schedule(CheckInventory.getInstance(), WMDClientConfig.TimerVal.get());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onLeave(LoggedOutEvent event){
|
||||
public static void onLeave(ClientPlayerNetworkEvent.LoggingOut event){
|
||||
//LOGGER.info("PLAYER LOGGED OUT");
|
||||
LOGGER.info(WMDPrefix+": : : PLAYER LOGGED OUT : : :");
|
||||
WatchMyDurability.isInGame=false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onClone(ClientPlayerNetworkEvent.RespawnEvent event)
|
||||
public static void onClone(ClientPlayerNetworkEvent.Clone event)
|
||||
{
|
||||
LOGGER.info(WMDPrefix+": : : : PLAYER RESPAWNED OR MOVED TO A NEW WORLD : : : :");
|
||||
|
||||
|
|
|
@ -71,6 +71,6 @@ Edit the config file to customize the alerts
|
|||
[[dependencies.watchmydurability]]
|
||||
modId="libzontreck"
|
||||
mandatory=true
|
||||
versionRange="[1.0.5.0,1.0.6.0)"
|
||||
versionRange="[1.0.6.0,1.0.7.0)"
|
||||
ordering="NONE"
|
||||
side="CLIENT"
|
Reference in a new issue