Files
src
build.gradle
gradle.properties
settings.gradle
Code
19 1,057
src/client/java/com/fullyutilize/FullUtilizeClient.java
package com.fullyutilize;
import com.fullyutilize.chunk.ChunkLoadManager;
import com.fullyutilize.chunk.MeshThreadManager;
import com.fullyutilize.config.ConfigManager;
import com.fullyutilize.core.CoreManager;
import com.fullyutilize.performance.AutoModeManager;
import com.fullyutilize.performance.PerformanceController;
import com.fullyutilize.screen.FullUtilizeScreen;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;
@Environment(EnvType.CLIENT)
public class FullUtilizeClient implements ClientModInitializer {
private static KeyBinding openScreenKey;
@Override
public void onInitializeClient() {
openScreenKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"fullyutilize.keybind.open_screen",
InputUtil.Type.KEYSYM,
GLFW.GLFW_KEY_F7,
"fullyutilize.keybind.category"
));
ClientTickEvents.END_CLIENT_TICK.register(client -> {
while (openScreenKey.wasPressed()) {
if (client.currentScreen == null) {
client.setScreen(new FullUtilizeScreen());
}
}
AutoModeManager.tick(client);
});
ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (client.world != null) {
PerformanceController.applyPendingIfNeeded(client);
}
});
PerformanceController.scheduleApply(ConfigManager.getConfig().performanceMode);
MeshThreadManager.apply(ConfigManager.getConfig().performanceMode);
Runtime.getRuntime().addShutdownHook(new Thread(CoreManager::shutdown));
}
public static KeyBinding getOpenScreenKey() {
return openScreenKey;
}
}