update to new fabric keybinding api and rebrand

This commit is contained in:
CoolMineman 2020-08-01 20:59:19 -05:00
parent b52bff174e
commit 4e396d2897
No known key found for this signature in database
GPG Key ID: 2439F5FE115256DD
3 changed files with 13 additions and 21 deletions

View File

@ -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);
}
}

View File

@ -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"
}

View File

@ -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": {