Finish updating to 1.20
This commit is contained in:
parent
5d62d175af
commit
d002986525
5 changed files with 14 additions and 5 deletions
|
@ -49,7 +49,7 @@ mod_name=WatchMyDurability
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=GPLv3
|
mod_license=GPLv3
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=1.1.5.1119230555
|
mod_version=1.1.5.1119230818
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package dev.zontreck.mcmods;
|
package dev.zontreck.mcmods;
|
||||||
|
|
||||||
import dev.zontreck.ariaslib.terminal.Task;
|
import dev.zontreck.ariaslib.terminal.Task;
|
||||||
|
import dev.zontreck.ariaslib.util.DelayedExecutorService;
|
||||||
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 net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package dev.zontreck.mcmods;
|
package dev.zontreck.mcmods;
|
||||||
|
|
||||||
import dev.zontreck.ariaslib.terminal.Task;
|
import dev.zontreck.ariaslib.terminal.Task;
|
||||||
|
import dev.zontreck.ariaslib.util.DelayedExecutorService;
|
||||||
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 net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -10,6 +11,11 @@ import net.minecraft.sounds.SoundEvents;
|
||||||
|
|
||||||
public class CheckHunger extends Task
|
public class CheckHunger extends Task
|
||||||
{
|
{
|
||||||
|
private static CheckHunger inst = new CheckHunger();
|
||||||
|
public static CheckHunger getInstance()
|
||||||
|
{
|
||||||
|
return inst;
|
||||||
|
}
|
||||||
public CheckHunger()
|
public CheckHunger()
|
||||||
{
|
{
|
||||||
super("CheckHunger", true);
|
super("CheckHunger", true);
|
||||||
|
@ -19,7 +25,9 @@ public class CheckHunger extends Task
|
||||||
public void run() {
|
public void run() {
|
||||||
if(!WMDClientConfig.EnableHungerAlert.get()) return;
|
if(!WMDClientConfig.EnableHungerAlert.get()) return;
|
||||||
|
|
||||||
|
|
||||||
Hunger current = Hunger.of(Minecraft.getInstance().player);
|
Hunger current = Hunger.of(Minecraft.getInstance().player);
|
||||||
|
if(WatchMyDurability.LastHunger == null)WatchMyDurability.LastHunger = new Hunger();
|
||||||
|
|
||||||
if(current.identical()) return;
|
if(current.identical()) return;
|
||||||
if(current.shouldGiveAlert())
|
if(current.shouldGiveAlert())
|
||||||
|
|
|
@ -38,8 +38,7 @@ public class CheckInventory extends Task {
|
||||||
|
|
||||||
if(!WatchMyDurability.isInGame)return;
|
if(!WatchMyDurability.isInGame)return;
|
||||||
|
|
||||||
DelayedExecutorService.getInstance().schedule(this,
|
|
||||||
WMDClientConfig.TimerVal.get());
|
|
||||||
//WatchMyDurability.LOGGER.info("TICKING CHECK INVENTORY EVENT");
|
//WatchMyDurability.LOGGER.info("TICKING CHECK INVENTORY EVENT");
|
||||||
// Get the player inventory
|
// Get the player inventory
|
||||||
Inventory inv = Minecraft.getInstance().player.getInventory();
|
Inventory inv = Minecraft.getInstance().player.getInventory();
|
||||||
|
|
|
@ -119,8 +119,9 @@ public class WatchMyDurability
|
||||||
WatchMyDurability.isInGame=true;
|
WatchMyDurability.isInGame=true;
|
||||||
DelayedExecutorService.start();
|
DelayedExecutorService.start();
|
||||||
|
|
||||||
DelayedExecutorService.getInstance().schedule(CheckInventory.getInstance(), WMDClientConfig.TimerVal.get());
|
DelayedExecutorService.getInstance().scheduleRepeating(CheckInventory.getInstance(), WMDClientConfig.TimerVal.get());
|
||||||
DelayedExecutorService.getInstance().schedule(CheckHealth.getInstance(), WMDClientConfig.TimerVal.get());
|
DelayedExecutorService.getInstance().scheduleRepeating(CheckHealth.getInstance(), WMDClientConfig.TimerVal.get());
|
||||||
|
DelayedExecutorService.getInstance().scheduleRepeating(CheckHunger.getInstance(), WMDClientConfig.TimerVal.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
Reference in a new issue