Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jar {
modrinth {
token = System.getenv("MODRINTH_TOKEN") // This is the default. Remember to have the MODRINTH_TOKEN environment variable set or else this will fail, or set it to whatever you want - just make sure it stays private!
projectId = project.archives_base_name // This can be the project ID or the slug. Either will work!
versionNumber = project.version // You don't need to set this manually. Will fail if Modrinth has this version already
versionNumber = "${project.minecraft_version}-${project.version}" // You don't need to set this manually. Will fail if Modrinth has this version already
versionName = "[1.19.x] HitBox+ ${project.version}"
versionType = project.release_type // This is the default -- can also be `beta` or `alpha`
uploadFile = remapJar // With Loom, this MUST be set to `remapJar` instead of `jar`!
Expand All @@ -81,7 +81,7 @@ modrinth {
// scope.type
// The scope can be `required`, `optional`, `incompatible`, or `embedded`
// The type can either be `project` or `version`
required.project "modmenu"
optional.project "modmenu"
required.project "cloth-config"
}
syncBodyFrom = rootProject.file("README.md").text
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/io/github/pingisfun/hitboxplus/HitboxPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.serializer.GsonConfigSerializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -34,5 +39,15 @@ public void onInitialize() {
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
AutoConfig.register(ModConfig.class, GsonConfigSerializer::new);

KeyBinding keyBinding = new KeyBinding("Open Config", InputUtil.GLFW_KEY_B, "HitBox+");
KeyBindingHelper.registerKeyBinding(keyBinding);

ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (keyBinding.isPressed()) {
Screen configScreen = AutoConfig.getConfigScreen(ModConfig.class, client.currentScreen).get();
client.setScreen(configScreen);
}
});
}
}