mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-14 14:33:57 +01:00
Why wait?
- Immediately audit on client tick
This commit is contained in:
parent
ed4379aa8f
commit
03f94fe88c
@ -1,33 +1,27 @@
|
||||
package dev.engine_room.flywheel;
|
||||
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
|
||||
public class FlywheelTestModClient implements ClientModInitializer {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger("Flywheel Test Mod");
|
||||
|
||||
private int ticks = 0;
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
LOGGER.info("Starting Test Mod, on Env: {}", FabricLoader.getInstance().getEnvironmentType());
|
||||
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
LOGGER.info("Tick Count: {}", ticks);
|
||||
|
||||
if (++ticks == 50) {
|
||||
LOGGER.info("Running mixin audit");
|
||||
MixinEnvironment.getCurrentEnvironment().audit();
|
||||
MixinEnvironment.getCurrentEnvironment()
|
||||
.audit();
|
||||
|
||||
LOGGER.info("Ran mixin audit, stopping client.");
|
||||
client.stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +1,31 @@
|
||||
package dev.engine_room.flywheel;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.spongepowered.asm.mixin.MixinEnvironment;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.loading.FMLLoader;
|
||||
|
||||
@Mod("flywheel_testmod")
|
||||
public class FlywheelTestModClient {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger("Flywheel Test Mod");
|
||||
|
||||
private int ticks = 0;
|
||||
|
||||
public FlywheelTestModClient() {
|
||||
LOGGER.info("Starting Test Mod, on Dist: {}", FMLLoader.getDist());
|
||||
|
||||
MinecraftForge.EVENT_BUS.addListener((TickEvent.ClientTickEvent e) -> {
|
||||
if (e.phase == TickEvent.Phase.END) {
|
||||
LOGGER.info("Tick Count: {}", ticks);
|
||||
|
||||
if (++ticks == 50) {
|
||||
LOGGER.info("Running mixin audit");
|
||||
MixinEnvironment.getCurrentEnvironment().audit();
|
||||
MixinEnvironment.getCurrentEnvironment()
|
||||
.audit();
|
||||
|
||||
LOGGER.info("Ran mixin audit, stopping client.");
|
||||
Minecraft.getInstance().stop();
|
||||
}
|
||||
Minecraft.getInstance()
|
||||
.stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user