mirror of
https://github.com/squeek502/Squake.git
synced 2025-08-03 17:58:08 -04:00
update to new fabric keybinding api and rebrand
This commit is contained in:
parent
b52bff174e
commit
4e396d2897
@ -3,30 +3,18 @@ package squeek.quakemovement;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.keybinding.FabricKeyBinding;
|
||||
import net.fabricmc.fabric.api.client.keybinding.KeyBindingRegistry;
|
||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
|
||||
import net.minecraft.client.options.KeyBinding;
|
||||
import net.minecraft.client.util.InputUtil;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class KeyBindInitializer implements ClientModInitializer
|
||||
{
|
||||
public static FabricKeyBinding ENABLE;
|
||||
public static String CATEGORY = "fabric.mods." + ModInfo.MODID;
|
||||
public class KeyBindInitializer implements ClientModInitializer {
|
||||
public static final String CATEGORY = "fabric.mods." + ModInfo.MODID;
|
||||
public static final KeyBinding ENABLE = new KeyBinding(CATEGORY + "." + "enable", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, CATEGORY);
|
||||
|
||||
@Override
|
||||
public void onInitializeClient()
|
||||
{
|
||||
KeyBindingRegistry.INSTANCE.addCategory(CATEGORY);
|
||||
ENABLE = registerKey("enable", GLFW.GLFW_KEY_UNKNOWN, CATEGORY);
|
||||
}
|
||||
|
||||
public static FabricKeyBinding registerKey(String name, Integer code, String category)
|
||||
{
|
||||
FabricKeyBinding key = FabricKeyBinding.Builder.create(new Identifier(ModInfo.MODID, name), InputUtil.Type.KEYSYM, code, category).build();
|
||||
KeyBindingRegistry.INSTANCE.register(key);
|
||||
|
||||
return key;
|
||||
public void onInitializeClient() {
|
||||
KeyBindingHelper.registerKeyBinding(ENABLE);
|
||||
}
|
||||
}
|
||||
|
@ -13,5 +13,8 @@
|
||||
"text.autoconfig.squake.option.trimpEnabled": "Trimp Enabled",
|
||||
"text.autoconfig.squake.option.fallDistanceThresholdIncrease": "Fall Distance Threshold Increase",
|
||||
"text.autoconfig.squake.option.maxAirAccelerationPerTick": "Max Air Acceleration Per Tick",
|
||||
"text.autoconfig.squake.option.enabled": "Enabled"
|
||||
"text.autoconfig.squake.option.enabled": "Enabled",
|
||||
|
||||
"fabric.mods.squake": "Squake Reloaded",
|
||||
"fabric.mods.squake.enable": "Toggle Squake Movement"
|
||||
}
|
@ -3,9 +3,10 @@
|
||||
"id": "squake",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "Squake",
|
||||
"name": "Squake Reloaded",
|
||||
"description": "Quake-style movement (bunnyhopping, etc) in Minecraft",
|
||||
"authors": [
|
||||
"ThatTrollzer/CoolMineman",
|
||||
"squeek502"
|
||||
],
|
||||
"contact": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user