super-secret-revival/src/main/java/zone/oat/supersecretrevival/Mod.java

39 lines
1.6 KiB
Java

package zone.oat.supersecretrevival;
import net.fabricmc.api.ClientModInitializer;
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 net.minecraft.text.Text;
import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Mod implements ClientModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("super-secret-revival");
// also used for identifying the button (Don't Worry about it)
public static final Text BUTTON_TEXT = Text.translatable("options.supersecretrevival.super_secret_settings");
private static KeyBinding disableShaderKeybind = KeyBindingHelper.registerKeyBinding(new KeyBinding(
"key.supersecretrevival.disable", // The translation key of the keybinding's name
InputUtil.Type.KEYSYM, // The type of the keybinding, KEYSYM for keyboard, MOUSE for mouse.
GLFW.GLFW_KEY_F4, // The keycode of the key
"key.categories.misc" // The translation key of the keybinding's category.
));
public static void triggerSuperSecretSettings() {
ShaderControls.setRandomShader();
RandomSoundPlayer.playRandomSound();
}
@Override
public void onInitializeClient() {
ClientTickEvents.END_CLIENT_TICK.register(client -> {
while (disableShaderKeybind.wasPressed()) {
ShaderControls.disableShader();
}
});
}
}