Switch away from using DelayedExecutor
This commit is contained in:
parent
ad182844cd
commit
13b6ce170c
2 changed files with 11 additions and 8 deletions
|
@ -3,7 +3,7 @@
|
|||
org.gradle.jvmargs=-Xmx3G
|
||||
org.gradle.daemon=false
|
||||
|
||||
libzontreck=1201.11.021624.1504
|
||||
libzontreck=1201.11.021824.0918
|
||||
|
||||
## Environment Properties
|
||||
|
||||
|
@ -48,7 +48,7 @@ mod_name=WatchMyDurability
|
|||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||
mod_license=GPLv3
|
||||
# The mod version. See https://semver.org/
|
||||
mod_version=1201.2.021624.1514
|
||||
mod_version=1201.2.021824.0932
|
||||
# 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.
|
||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||
|
|
|
@ -17,6 +17,7 @@ import net.minecraft.client.Minecraft;
|
|||
import net.minecraft.client.User;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
|
@ -55,6 +56,7 @@ public class WatchMyDurability
|
|||
{
|
||||
|
||||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
DelayedExecutorService.setup();
|
||||
|
||||
// Register the commonSetup method for modloading
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
|
@ -95,7 +97,6 @@ public class WatchMyDurability
|
|||
//LOGGER.info("HELLO FROM CLIENT SETUP");
|
||||
//LOGGER.info("MINECRAFT NAME >> {}", Minecraft.getInstance().getUser().getName());
|
||||
WatchMyDurability.CurrentUser = Minecraft.getInstance().getUser();
|
||||
DelayedExecutorService.setup();
|
||||
|
||||
|
||||
//time.schedule(new CheckInventory(),
|
||||
|
@ -118,11 +119,14 @@ public class WatchMyDurability
|
|||
//LOGGER.info("PLAYER LOGGED IN");
|
||||
LOGGER.info(": : : PLAYER LOGGED IN : : :");
|
||||
WatchMyDurability.isInGame=true;
|
||||
DelayedExecutorService.start();
|
||||
}
|
||||
|
||||
DelayedExecutorService.getInstance().scheduleRepeating(CheckInventory.getInstance(), WMDClientConfig.TimerVal.get());
|
||||
DelayedExecutorService.getInstance().scheduleRepeating(CheckHealth.getInstance(), WMDClientConfig.TimerVal.get());
|
||||
DelayedExecutorService.getInstance().scheduleRepeating(CheckHunger.getInstance(), WMDClientConfig.TimerVal.get());
|
||||
@SubscribeEvent
|
||||
public static void onTick(TickEvent.ClientTickEvent ev)
|
||||
{
|
||||
CheckInventory.getInstance().run();
|
||||
CheckHealth.getInstance().run();
|
||||
CheckHunger.getInstance().run();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
@ -131,7 +135,6 @@ public class WatchMyDurability
|
|||
LOGGER.info(": : : PLAYER LOGGED OUT : : :");
|
||||
WatchMyDurability.isInGame=false;
|
||||
WatchMyDurability.WMD_SERVER_AVAILABLE=false;
|
||||
DelayedExecutorService.stop();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
Reference in a new issue