diff --git a/README.md b/README.md index 78c8b4b..9e1add5 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + # Too Many Binds [![CurseForge downloads](https://cf.way2muchnoise.eu/412915.svg)](https://www.curseforge.com/minecraft/mc-mods/too-many-binds) diff --git a/build.gradle b/build.gradle index 94cf27e..a09d8e9 100644 --- a/build.gradle +++ b/build.gradle @@ -69,6 +69,40 @@ allprojects { dependencies { modImplementation "net.fabricmc:fabric-loader:${project.fabric_loader_version}" + + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + + // Required Fabric API modules + modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version) + modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version) + modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version) + + // Amecs API + //modImplementation "de.siphalor:amecsapi-1.19:${project.amecs_api_version}" + + // ModMenu + modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" + // Cloth Config + modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { + exclude(group: 'net.fabricmc.fabric-api') + } + + if (project.use_third_party_mods == 'true') { + configurations { + modRuntimeOnly { + exclude module: 'fabric-lifecycle-events-v1' + exclude module: 'fabric-key-binding-api-v1' + } + } + + modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}" + //modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version}" + //modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version}" + modRuntimeOnly "maven.modrinth:starlight:${project.starlight_version}" + //modRuntimeOnly "maven.modrinth:smoothboot-fabric:${project.smoothboot_version}" + modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version}" + } } @@ -100,19 +134,6 @@ allprojects { } -dependencies { - include project(path: ':toomanybinds-core', configuration: 'namedElements') - include project(path: ':toomanybinds-1.16-compat', configuration: 'namedElements') - include project(path: ':toomanybinds-1.17-compat', configuration: 'namedElements') - include project(path: ':toomanybinds-1.18.2-compat', configuration: 'namedElements') - include project(path: ':toomanybinds-1.19-compat', configuration: 'namedElements') - include project(path: ':toomanybinds-1.19.3-compat', configuration: 'namedElements') - - minecraft "com.mojang:minecraft:${minecraft_version_1_19_3}" - mappings "net.fabricmc:yarn:${project.yarn_mappings_1_19_3}:v2" -} - - processResources { from("${rootDir}/assets/icon.png") { into "assets/toomanybinds/" diff --git a/gradle.properties b/gradle.properties index 8b756e4..c8ee0c3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,91 +13,17 @@ mod_version = 0.3.3 maven_group = com.github.reviversmc archives_base_name = toomanybinds -# Global Dependencies fabric_loader_version = 0.14.14 -# Module Dependencies -# 1.16 -minecraft_version_1_16 = 1.16.5 -yarn_mappings_1_16 = 1.16.5+build.10 -fabric_api_version_1_16 = 0.42.0+1.16 -amecs_api_version_1_16 = 1.3.7+mc1.16.5 -modmenu_version_1_16 = 1.16.23 -cloth_config_version_1_16 = 4.15.82 -# 1.17 -minecraft_version_1_17 = 1.17.1 -yarn_mappings_1_17 = 1.17.1+build.65 -fabric_api_version_1_17 = 0.46.1+1.17 -amecs_api_version_1_17 = 1.3.7+mc1.17.1 -nmuk_version_1_17 = 1.0.1+mc1.17 -modmenu_version_1_17 = 2.0.17 -cloth_config_version_1_17 = 5.3.63 -# 1.18.2 -minecraft_version_1_18_2 = 1.18.2 -yarn_mappings_1_18_2 = 1.18.2+build.3 -fabric_api_version_1_18_2 = 0.56.1+1.18.2 -amecs_api_version_1_18_2 = 1.3.6+mc22w06a -modmenu_version_1_18_2 = 3.2.5 -cloth_config_version_1_18_2 = 6.3.81 -# 1.19 -minecraft_version_1_19 = 1.19.2 -yarn_mappings_1_19 = 1.19.2+build.28 -fabric_api_version_1_19 = 0.70.0+1.19.2 -amecs_api_version_1_19 = 1.3.7+mc22w17a -nmuk_version_1_19 = 1.0.2+mc1.19.2 -modmenu_version_1_19 = 4.1.2 -cloth_config_version_1_19 = 8.2.88 -# 1.19.3 -minecraft_version_1_19_3 = 1.19.3 -yarn_mappings_1_19_3 = 1.19.3+build.5 -fabric_api_version_1_19_3 = 0.73.2+1.19.3 -amecs_api_version_1_19_3 = 1.3.7+mc1.19.3 -nmuk_version_1_19_3 = 1.0.2+mc1.19.3 -modmenu_version_1_19_3 = 5.0.2 -cloth_config_version_1_19_3 = 9.0.94 +minecraft_version=1.19.4-rc2 +yarn_mappings = 1.19.4-rc2+build.1 +fabric_api_version = 0.75.3+1.19.4 +amecs_api_version= 1.3.7+mc1.19.3 +modmenu_version = 6.1.0-beta.3 +cloth_config_version = 10.0.95 # If true, third-party mods will be loaded during runtime in the developer run configurations use_third_party_mods = true -# 1.16 -lazydfu_version_1_16 = 0.1.2 -sodium_version_1_16 = mc1.16.5-0.2.0 -lithium_version_1_16 = mc1.16.5-0.6.6 -phosphor_version_1_16 = mc1.16.2-0.8.0 -ferrite_core_version_1_16 = 2.1.1-fabric -smoothboot_version_1_16 = 1.16.5-1.6.0 -no_fade_version_1_16 = 3228523 -# 1.17 -lazydfu_version_1_17 = 0.1.2 -sodium_version_1_17 = mc1.17.1-0.3.4 -joml_version_sodium_1_17 = 1.10.2 -lithium_version_1_17 = mc1.17.1-0.7.5 -starlight_version_1_17 = Starlight 1.0.0 1.17.x -ferrite_core_version_1_17 = 3.1.0 -smoothboot_version_1_17 = 1.16.5-1.6.0 -no_fade_version_1_17 = 3355800 -# 1.18.2 -lazydfu_version_1_18_2 = 0.1.2 -sodium_version_1_18_2 = mc1.18.2-0.4.1 -joml_version_sodium_1_18_2 = 1.10.2 -lithium_version_1_18_2 = mc1.18.2-0.10.3 -starlight_version_1_18_2 = 1.0.2+1.18.2 -ferrite_core_version_1_18_2 = 4.2.1-fabric -smoothboot_version_1_18_2 = 3692365 -no_fade_version_1_18_2 = 3550935 -# 1.19 -lazydfu_version_1_19 = 0.1.3 -sodium_version_1_19 = mc1.19.2-0.4.4 -joml_version_sodium_1_19 = 1.10.4 -lithium_version_1_19 = mc1.19.2-0.10.4 -starlight_version_1_19 = 1.1.1+1.19 -ferrite_core_version_1_19 = 5.0.3-fabric -smoothboot_version_1_19 = 1.19-1.7.1 -no_fade_version_1_19 = 3550935 -# 1.19.3 -lazydfu_version_1_19_3 = 0.1.3 -sodium_version_1_19_3 = mc1.19.3-0.4.8 -lithium_version_1_19_3 = mc1.19.3-0.10.4 -starlight_version_1_19_3 = 1.1.1+1.19 -ferrite_core_version_1_19_3 = 5.1.0-fabric -smoothboot_version_1_19_3 = 1.19-1.7.1 -no_fade_version_1_19_3 = 3550935 + +starlight_version = 1.1.1+1.19 +no_fade_version = 3550935 diff --git a/settings.gradle b/settings.gradle index cd2a00a..cd135e7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -14,10 +14,3 @@ pluginManagement { } rootProject.name = 'toomanybinds' - -include 'toomanybinds-core' -include 'toomanybinds-1.16-compat' -include 'toomanybinds-1.17-compat' -include 'toomanybinds-1.18.2-compat' -include 'toomanybinds-1.19-compat' -include 'toomanybinds-1.19.3-compat' diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen.java b/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen.java similarity index 92% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen.java rename to src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen.java index 5c5a002..c8524b7 100644 --- a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen.java +++ b/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen.java @@ -13,7 +13,7 @@ import com.github.reviversmc.toomanybinds.autocompletion.BindSuggestion; import com.github.reviversmc.toomanybinds.autocompletion.LauncherCompletion; -public abstract class LauncherScreen extends Screen { +public class LauncherScreen extends Screen { protected final int SUGGESTION_COLOR = 0x999999; protected final int HIGHLIGHT_COLOR = 0xFFFF00; @@ -61,7 +61,7 @@ public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { int lineAmt = Math.min(suggestions.size(), TooManyBinds.config.maxSuggestions); int bgColor = (int) Math.round(TooManyBinds.config.bgOpacity * 255) * 0x1000000; fill(matrices, getX()-1, getY()-1, getX()+w-1, getY()+lineHeight-2 + lineAmt * lineHeight, bgColor); - textField.setTextFieldFocused(true); + textField.setFocused(true); textField.render(matrices, mouseX, mouseY, delta); int y = getY(); @@ -120,7 +120,7 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { return true; } else if (keyCode == GLFW.GLFW_KEY_ENTER || keyCode == GLFW.GLFW_KEY_KP_ENTER) { List suggestions = completion.getSuggestions(); - closeScreen(); + client.setScreen(null); if (suggestions.size() > selected) { suggestions.get(selected).execute(); @@ -133,8 +133,6 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { || super.keyPressed(keyCode, scanCode, modifiers); } - protected abstract void closeScreen(); - public void textChangeListener(String s) { completion.updateSuggestions(s); selected = 0; @@ -146,21 +144,16 @@ protected void init() { baseX = (width - w) / 2; baseY = (height - lineHeight) / 2; - setRepeatKeyboardEvents(true); - String text = ""; if (textField != null) text = textField.getText(); textField = new TextFieldWidget(textRenderer, getX(), getY()+1, w, lineHeight, NarratorManager.EMPTY); textField.setDrawsBackground(false); textField.setChangedListener(this::textChangeListener); textField.setText(text); - addTextField(textField); + addSelectableChild(textField); setInitialFocus(textField); } - protected abstract void setRepeatKeyboardEvents(boolean repeatEvents); - protected abstract void addTextField(TextFieldWidget textField); - @Override public void tick() { textField.tick(); @@ -171,14 +164,8 @@ public void resize(MinecraftClient client, int width, int height) { init(client, width, height); } - @Override - public boolean isPauseScreen() { - return false; - } - @Override public void removed() { - setRepeatKeyboardEvents(false); TooManyBinds.config.launcherX = offsetX; TooManyBinds.config.launcherY = offsetY; AutoConfig.getConfigHolder(ModConfig.class).save(); diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/ModConfig.java b/src/main/java/com/github/reviversmc/toomanybinds/ModConfig.java similarity index 100% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/ModConfig.java rename to src/main/java/com/github/reviversmc/toomanybinds/ModConfig.java diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds.java b/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds.java similarity index 82% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds.java rename to src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds.java index 5bed482..a2e5d56 100644 --- a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds.java +++ b/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds.java @@ -14,7 +14,7 @@ import com.github.reviversmc.toomanybinds.autocompletion.LauncherCompletion; import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions; -public abstract class TooManyBinds implements ModInitializer { +public class TooManyBinds implements ModInitializer { public static ModConfig config; public static KeyBinding launcherKey; public static KeyBinding favoriteKey; @@ -36,15 +36,12 @@ public void onInitialize() { "category.toomanybinds")); ClientTickEvents.END_CLIENT_TICK.register(client -> { - if (launcherKey.wasPressed()) openNewLauncherScreen(client); + if (launcherKey.wasPressed()) client.setScreen(new LauncherScreen()); }); ClientLifecycleEvents.CLIENT_STARTED.register(t -> LauncherCompletion.loadData()); ClientLifecycleEvents.CLIENT_STOPPING.register(t -> LauncherCompletion.saveData()); - LauncherCompletion.suggestionProviders.add(newVanillaKeyBindSuggestions()); + LauncherCompletion.suggestionProviders.add(new VanillaKeybindSuggestions()); } - - protected abstract void openNewLauncherScreen(MinecraftClient client); - protected abstract VanillaKeybindSuggestions newVanillaKeyBindSuggestions(); } diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion.java b/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion.java similarity index 62% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion.java rename to src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion.java index 7ec0cfd..6f1d831 100644 --- a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion.java +++ b/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion.java @@ -1,17 +1,15 @@ package com.github.reviversmc.toomanybinds.autocompletion; -import java.util.function.Consumer; -import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.option.GameOptions; import net.minecraft.client.option.KeyBinding; +import net.minecraft.client.util.ScreenshotRecorder; import net.minecraft.text.Text; -import com.github.reviversmc.toomanybinds.integrations.AmecsIntegration; import com.github.reviversmc.toomanybinds.mixinterface.KeyBindingMixinterface; -public abstract class BindSuggestion { +public class BindSuggestion { public Text name; public Text category; public KeyBinding bind; @@ -20,13 +18,11 @@ public abstract class BindSuggestion { public BindSuggestion(KeyBinding bind) { this.bind = bind; - name = newTranslatableText(bind.getTranslationKey()); - category = newTranslatableText(bind.getCategory()); + name = Text.translatable(bind.getTranslationKey()); + category = Text.translatable(bind.getCategory()); searchable = (name.getString() + " " + category.getString()).toLowerCase(); } - protected abstract Text newTranslatableText(String key); - public boolean matches(String[] searchTerms) { for (String term : searchTerms) { if (!searchable.contains(term)) return false; @@ -42,12 +38,12 @@ public void execute() { LauncherCompletion.addToHistory(getId()); // workarounds for keybinds that are handled in dumb, incompatible ways - if (bind == fullscreenKey(options)) { + if (bind == options.fullscreenKey) { mc.getWindow().toggleFullscreen(); - saveFullscreenState(mc.options, mc.getWindow().isFullscreen()); + options.getFullscreen().setValue(mc.getWindow().isFullscreen()); mc.options.write(); - } else if (bind == screenshotKey(options)) { - takeScreenshot(mc, (text) -> { + } else if (bind == options.screenshotKey) { + ScreenshotRecorder.saveScreenshot(mc.runDirectory, mc.getFramebuffer(), text -> { mc.execute(() -> { mc.inGameHud.getChatHud().addMessage(text); }); @@ -58,17 +54,13 @@ public void execute() { bind.setPressed(false); // Amecs compat + /* if (FabricLoader.getInstance().isModLoaded("amecsapi")) { AmecsIntegration.priorityPressIfApplicable(bind); } + */ } } - - protected abstract KeyBinding fullscreenKey(GameOptions options); - protected abstract void saveFullscreenState(GameOptions options, boolean fullscreen); - protected abstract KeyBinding screenshotKey(GameOptions options); - protected abstract void takeScreenshot(MinecraftClient mc, Consumer messageReceiver); - public String getId() { return bind.getTranslationKey(); } diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/LauncherCompletion.java b/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/LauncherCompletion.java similarity index 100% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/LauncherCompletion.java rename to src/main/java/com/github/reviversmc/toomanybinds/autocompletion/LauncherCompletion.java diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/SuggestionProvider.java b/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/SuggestionProvider.java similarity index 100% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/SuggestionProvider.java rename to src/main/java/com/github/reviversmc/toomanybinds/autocompletion/SuggestionProvider.java diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions.java b/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions.java similarity index 75% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions.java rename to src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions.java index f39cc59..0f715c5 100644 --- a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions.java +++ b/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions.java @@ -11,7 +11,7 @@ import com.github.reviversmc.toomanybinds.TooManyBinds; -public abstract class VanillaKeybindSuggestions implements SuggestionProvider { +public class VanillaKeybindSuggestions implements SuggestionProvider { private static final Set blacklist = new HashSet(Arrays.asList( // pointless "key.use", @@ -32,17 +32,12 @@ public abstract class VanillaKeybindSuggestions implements SuggestionProvider { "key.saveToolbarActivator", "key.loadToolbarActivator" )); - - protected abstract KeyBinding[] allKeys(GameOptions options); - public void addEntries(List binds) { - for (KeyBinding bind : allKeys(MinecraftClient.getInstance().options)) { + for (KeyBinding bind : MinecraftClient.getInstance().options.allKeys) { if ((bind.isUnbound() || !TooManyBinds.config.hideBoundKeys) && !blacklist.contains(bind.getTranslationKey())) { - binds.add(newBindSuggestion(bind)); + binds.add(new BindSuggestion(bind)); } } } - - protected abstract BindSuggestion newBindSuggestion(KeyBinding bind); } diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/integrations/AmecsIntegration.java b/src/main/java/com/github/reviversmc/toomanybinds/integrations/AmecsIntegration.java similarity index 73% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/integrations/AmecsIntegration.java rename to src/main/java/com/github/reviversmc/toomanybinds/integrations/AmecsIntegration.java index 8751a92..ac7e2bd 100644 --- a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/integrations/AmecsIntegration.java +++ b/src/main/java/com/github/reviversmc/toomanybinds/integrations/AmecsIntegration.java @@ -1,12 +1,12 @@ package com.github.reviversmc.toomanybinds.integrations; -import de.siphalor.amecs.api.PriorityKeyBinding; -import net.minecraft.client.option.KeyBinding; - public class AmecsIntegration { + /* public static void priorityPressIfApplicable(KeyBinding binding) { if (binding instanceof PriorityKeyBinding) { ((PriorityKeyBinding) binding).onPressedPriority(); } } + + */ } diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/integrations/ModMenuIntegration.java b/src/main/java/com/github/reviversmc/toomanybinds/integrations/ModMenuIntegration.java similarity index 100% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/integrations/ModMenuIntegration.java rename to src/main/java/com/github/reviversmc/toomanybinds/integrations/ModMenuIntegration.java diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/mixin/KeyBindingMixin.java b/src/main/java/com/github/reviversmc/toomanybinds/mixin/KeyBindingMixin.java similarity index 100% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/mixin/KeyBindingMixin.java rename to src/main/java/com/github/reviversmc/toomanybinds/mixin/KeyBindingMixin.java diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/mixinterface/KeyBindingMixinterface.java b/src/main/java/com/github/reviversmc/toomanybinds/mixinterface/KeyBindingMixinterface.java similarity index 100% rename from toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/mixinterface/KeyBindingMixinterface.java rename to src/main/java/com/github/reviversmc/toomanybinds/mixinterface/KeyBindingMixinterface.java diff --git a/assets/icon.png b/src/main/resources/assets/toomanybinds/icon.png similarity index 100% rename from assets/icon.png rename to src/main/resources/assets/toomanybinds/icon.png diff --git a/toomanybinds-core/src/main/resources/assets/toomanybinds/lang/en_us.json b/src/main/resources/assets/toomanybinds/lang/en_us.json similarity index 100% rename from toomanybinds-core/src/main/resources/assets/toomanybinds/lang/en_us.json rename to src/main/resources/assets/toomanybinds/lang/en_us.json diff --git a/toomanybinds-core/src/main/resources/assets/toomanybinds/lang/et_ee.json b/src/main/resources/assets/toomanybinds/lang/et_ee.json similarity index 100% rename from toomanybinds-core/src/main/resources/assets/toomanybinds/lang/et_ee.json rename to src/main/resources/assets/toomanybinds/lang/et_ee.json diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 263e0d8..07f08c2 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -19,11 +19,16 @@ "entrypoints": { "modmenu": [ "com.github.reviversmc.toomanybinds.integrations.ModMenuIntegration" + ], + "main": [ + "com.github.reviversmc.toomanybinds.TooManyBinds" ] }, + "mixins": [ + "toomanybinds.mixins.json" + ], "depends": { - "minecraft": ">=1.16", - "fabricloader": ">=0.12.9", - "toomanybinds-compat-1-19-3": "*" + "minecraft": ">=1.19.4-rc.2", + "fabricloader": ">=0.12.9" } } diff --git a/toomanybinds-core/src/main/resources/toomanybinds.mixins.json b/src/main/resources/toomanybinds.mixins.json similarity index 100% rename from toomanybinds-core/src/main/resources/toomanybinds.mixins.json rename to src/main/resources/toomanybinds.mixins.json diff --git a/toomanybinds-1.16-compat/build.gradle b/toomanybinds-1.16-compat/build.gradle deleted file mode 100644 index 2753ac1..0000000 --- a/toomanybinds-1.16-compat/build.gradle +++ /dev/null @@ -1,51 +0,0 @@ -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 - - -archivesBaseName += '-compat-1.16' - - -dependencies { - api project(path: ':toomanybinds-core', configuration: 'namedElements') - - minecraft "com.mojang:minecraft:${project.minecraft_version_1_16}" - mappings "net.fabricmc:yarn:${project.yarn_mappings_1_16}:v2" - - // Required Fabric API modules - modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version_1_16) - modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version_1_16) - modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version_1_16) - - // Amecs API - modImplementation "de.siphalor:amecsapi-1.16:${project.amecs_api_version_1_16}" - - // ModMenu - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version_1_16}" - // Cloth Config - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version_1_16}") { - exclude(group: 'net.fabricmc.fabric-api') - } - - - if (project.use_third_party_mods == 'true') { - configurations { - modRuntimeOnly { - exclude module: 'fabric-lifecycle-events-v1' - exclude module: 'fabric-key-binding-api-v1' - } - } - - modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version_1_16}" - modRuntimeOnly "maven.modrinth:lazydfu:${project.lazydfu_version_1_16}" - modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version_1_16}" - modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version_1_16}" - modRuntimeOnly "maven.modrinth:phosphor:${project.phosphor_version_1_16}" - modRuntimeOnly "maven.modrinth:smoothboot-fabric:${project.smoothboot_version_1_16}" - modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version_1_16}" - } -} - - -tasks.withType(JavaCompile).configureEach { - it.options.release = 8 -} diff --git a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar116.java b/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar116.java deleted file mode 100644 index af59e1d..0000000 --- a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar116.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -public class EntrypointRegistrar116 extends EntrypointRegistrarBase { - @Override - public void onInitialize() { - if (isCompatible("1.16", "1.16.5")) { - EntrypointLauncher.setVersionSpecificInitializer(new TooManyBinds116()); - } - } -} diff --git a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen116.java b/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen116.java deleted file mode 100644 index fa4eb65..0000000 --- a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen116.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import net.minecraft.client.gui.widget.TextFieldWidget; - -public class LauncherScreen116 extends LauncherScreen { - @Override - protected void closeScreen() { - client.openScreen(null); - } - - @Override - protected void addTextField(TextFieldWidget textField) { - children.add(textField); - } - - @Override - protected void setRepeatKeyboardEvents(boolean repeatEvents) { - client.keyboard.setRepeatEvents(repeatEvents); - } -} diff --git a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds116.java b/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds116.java deleted file mode 100644 index 8b8accf..0000000 --- a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds116.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import net.minecraft.client.MinecraftClient; - -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions; -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions116; - -public class TooManyBinds116 extends TooManyBinds { - @Override - protected VanillaKeybindSuggestions newVanillaKeyBindSuggestions() { - return new VanillaKeybindSuggestions116(); - } - - @Override - protected void openNewLauncherScreen(MinecraftClient client) { - client.openScreen(new LauncherScreen116()); - } -} diff --git a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion116.java b/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion116.java deleted file mode 100644 index 5a7d229..0000000 --- a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion116.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import java.util.function.Consumer; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.option.GameOptions; -import net.minecraft.client.option.KeyBinding; -import net.minecraft.client.util.ScreenshotUtils; -import net.minecraft.text.Text; -import net.minecraft.text.TranslatableText; - -public class BindSuggestion116 extends BindSuggestion { - public BindSuggestion116(KeyBinding bind) { - super(bind); - } - - @Override - protected Text newTranslatableText(String key) { - return new TranslatableText(key); - } - - @Override - protected KeyBinding fullscreenKey(GameOptions options) { - return options.keyFullscreen; - } - - @Override - protected void saveFullscreenState(GameOptions options, boolean fullscreen) { - options.fullscreen = fullscreen; - } - - @Override - protected KeyBinding screenshotKey(GameOptions options) { - return options.keyScreenshot; - } - - @Override - protected void takeScreenshot(MinecraftClient mc, Consumer consumer) { - ScreenshotUtils.saveScreenshot(mc.runDirectory, mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight(), mc.getFramebuffer(), consumer); - } -} diff --git a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions116.java b/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions116.java deleted file mode 100644 index f517e55..0000000 --- a/toomanybinds-1.16-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions116.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import net.minecraft.client.option.GameOptions; -import net.minecraft.client.option.KeyBinding; - -public class VanillaKeybindSuggestions116 extends VanillaKeybindSuggestions { - @Override - protected BindSuggestion newBindSuggestion(KeyBinding bind) { - return new BindSuggestion116(bind); - } - - @Override - protected KeyBinding[] allKeys(GameOptions options) { - return options.keysAll; - } -} diff --git a/toomanybinds-1.16-compat/src/main/resources/fabric.mod.json b/toomanybinds-1.16-compat/src/main/resources/fabric.mod.json deleted file mode 100644 index 3cdacfa..0000000 --- a/toomanybinds-1.16-compat/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schemaVersion": 1, - "id": "toomanybinds-compat-1-16", - "version": "${version}", - "name": "Too Many Binds 1.16 Compat", - "environment": "client", - "entrypoints": { - "main": [ - "com.github.reviversmc.toomanybinds.EntrypointRegistrar116" - ] - }, - "depends": { - "toomanybinds-core": "*" - }, - "custom": { - "modmenu": { - "badges": ["library"], - "parent": { - "id": "toomanybinds" - } - } - } -} diff --git a/toomanybinds-1.17-compat/build.gradle b/toomanybinds-1.17-compat/build.gradle deleted file mode 100644 index d8c8923..0000000 --- a/toomanybinds-1.17-compat/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 - - -archivesBaseName += '-compat-1.17' - - -dependencies { - api project(path: ':toomanybinds-1.16-compat', configuration: 'namedElements') - - minecraft "com.mojang:minecraft:${project.minecraft_version_1_17}" - mappings "net.fabricmc:yarn:${project.yarn_mappings_1_17}:v2" - - // Required Fabric API modules - modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version_1_17) - modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version_1_17) - modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version_1_17) - - // Amecs API - modImplementation "de.siphalor:amecsapi-1.17:${project.amecs_api_version_1_17}" - // Nmuk version that is compatible with latest Fabric API - modImplementation "de.siphalor:nmuk-1.17:${project.nmuk_version_1_17}" - - // ModMenu - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version_1_17}" - // Cloth Config - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version_1_17}") { - exclude(group: 'net.fabricmc.fabric-api') - } - - - if (project.use_third_party_mods == 'true') { - configurations { - modRuntimeOnly { - exclude module: 'fabric-lifecycle-events-v1' - exclude module: 'fabric-key-binding-api-v1' - } - } - - modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version_1_17}" - modRuntimeOnly "maven.modrinth:lazydfu:${project.lazydfu_version_1_17}" - modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version_1_17}" - runtimeOnly "org.joml:joml:${project.joml_version_sodium_1_17}" - modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version_1_17}" - modRuntimeOnly "maven.modrinth:starlight:${project.starlight_version_1_17}" - modRuntimeOnly "maven.modrinth:smoothboot-fabric:${project.smoothboot_version_1_17}" - modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version_1_17}" - } -} - - -tasks.withType(JavaCompile).configureEach { - // Minecraft 1.17 (21w19a) upwards uses Java 16. - it.options.release = 17 -} diff --git a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar117.java b/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar117.java deleted file mode 100644 index 0d0de90..0000000 --- a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar117.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -public class EntrypointRegistrar117 extends EntrypointRegistrarBase { - @Override - public void onInitialize() { - if (isCompatible("1.17", "1.18.1")) { - EntrypointLauncher.setVersionSpecificInitializer(new TooManyBinds117()); - } - } -} diff --git a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen117.java b/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen117.java deleted file mode 100644 index 2830ae8..0000000 --- a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen117.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import net.minecraft.client.gui.widget.TextFieldWidget; - -public class LauncherScreen117 extends LauncherScreen116 { - @Override - protected void closeScreen() { - client.setScreen(null); - } - - @Override - protected void addTextField(TextFieldWidget textField) { - addSelectableChild(textField); - } -} diff --git a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds117.java b/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds117.java deleted file mode 100644 index 521a1c1..0000000 --- a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds117.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import net.minecraft.client.MinecraftClient; - -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions; -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions117; - -public class TooManyBinds117 extends TooManyBinds116 { - @Override - protected VanillaKeybindSuggestions newVanillaKeyBindSuggestions() { - return new VanillaKeybindSuggestions117(); - } - - @Override - protected void openNewLauncherScreen(MinecraftClient client) { - client.setScreen(new LauncherScreen117()); - } -} diff --git a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion117.java b/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion117.java deleted file mode 100644 index e8c7de7..0000000 --- a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion117.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import java.util.function.Consumer; - -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.option.KeyBinding; -import net.minecraft.client.util.ScreenshotRecorder; -import net.minecraft.text.Text; - -public class BindSuggestion117 extends BindSuggestion116 { - public BindSuggestion117(KeyBinding bind) { - super(bind); - } - - @Override - protected void takeScreenshot(MinecraftClient mc, Consumer consumer) { - ScreenshotRecorder.saveScreenshot(mc.runDirectory, mc.getFramebuffer(), consumer); - } -} diff --git a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions117.java b/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions117.java deleted file mode 100644 index 76da925..0000000 --- a/toomanybinds-1.17-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions117.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import net.minecraft.client.option.KeyBinding; - -public class VanillaKeybindSuggestions117 extends VanillaKeybindSuggestions116 { - @Override - protected BindSuggestion newBindSuggestion(KeyBinding bind) { - return new BindSuggestion117(bind); - } -} diff --git a/toomanybinds-1.17-compat/src/main/resources/fabric.mod.json b/toomanybinds-1.17-compat/src/main/resources/fabric.mod.json deleted file mode 100644 index 9073968..0000000 --- a/toomanybinds-1.17-compat/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schemaVersion": 1, - "id": "toomanybinds-compat-1-17", - "version": "${version}", - "name": "Too Many Binds 1.17 Compat", - "environment": "client", - "entrypoints": { - "main": [ - "com.github.reviversmc.toomanybinds.EntrypointRegistrar117" - ] - }, - "depends": { - "toomanybinds-compat-1-16": "*" - }, - "custom": { - "modmenu": { - "badges": ["library"], - "parent": { - "id": "toomanybinds" - } - } - } -} diff --git a/toomanybinds-1.18.2-compat/build.gradle b/toomanybinds-1.18.2-compat/build.gradle deleted file mode 100644 index f003199..0000000 --- a/toomanybinds-1.18.2-compat/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - - -archivesBaseName += '-compat-1.18.2' - - -dependencies { - api project(path: ':toomanybinds-1.17-compat', configuration: 'namedElements') - - minecraft "com.mojang:minecraft:${project.minecraft_version_1_18_2}" - mappings "net.fabricmc:yarn:${project.yarn_mappings_1_18_2}:v2" - - // Required Fabric API modules - modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version_1_18_2) - modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version_1_18_2) - modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version_1_18_2) - - // Amecs API - modImplementation "de.siphalor:amecsapi-1.18:${project.amecs_api_version_1_18_2}" - - // ModMenu - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version_1_18_2}" - // Cloth Config - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version_1_18_2}") { - exclude(group: 'net.fabricmc.fabric-api') - } - - - if (project.use_third_party_mods == 'true') { - configurations { - modRuntimeOnly { - exclude module: 'fabric-lifecycle-events-v1' - exclude module: 'fabric-key-binding-api-v1' - } - } - - modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version_1_18_2}" - modRuntimeOnly "maven.modrinth:lazydfu:${project.lazydfu_version_1_18_2}" - modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version_1_18_2}" - runtimeOnly "org.joml:joml:${project.joml_version_sodium_1_18_2}" - modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version_1_18_2}" - modRuntimeOnly "maven.modrinth:starlight:${project.starlight_version_1_18_2}" - modRuntimeOnly "curse.maven:smooth-boot-415758:${project.smoothboot_version_1_18_2}" - modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version_1_18_2}" - } -} - - -tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18-pre2 upwards uses Java 17. - it.options.release = 17 -} diff --git a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar1182.java b/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar1182.java deleted file mode 100644 index ae6cefd..0000000 --- a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar1182.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -public class EntrypointRegistrar1182 extends EntrypointRegistrarBase { - @Override - public void onInitialize() { - if (isCompatible("1.18.2", "1.18.2")) { - EntrypointLauncher.setVersionSpecificInitializer(new TooManyBinds1182()); - } - } -} diff --git a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds1182.java b/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds1182.java deleted file mode 100644 index dd1b1ed..0000000 --- a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds1182.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions; -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions1182; - -public class TooManyBinds1182 extends TooManyBinds117 { - @Override - protected VanillaKeybindSuggestions newVanillaKeyBindSuggestions() { - return new VanillaKeybindSuggestions1182(); - } -} diff --git a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion1182.java b/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion1182.java deleted file mode 100644 index e0c6c2d..0000000 --- a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion1182.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import net.minecraft.client.option.GameOptions; -import net.minecraft.client.option.KeyBinding; - -public class BindSuggestion1182 extends BindSuggestion117 { - public BindSuggestion1182(KeyBinding bind) { - super(bind); - } - - @Override - protected KeyBinding fullscreenKey(GameOptions options) { - return options.fullscreenKey; - } - - @Override - protected KeyBinding screenshotKey(GameOptions options) { - return options.screenshotKey; - } -} diff --git a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions1182.java b/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions1182.java deleted file mode 100644 index f84160b..0000000 --- a/toomanybinds-1.18.2-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions1182.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import net.minecraft.client.option.GameOptions; -import net.minecraft.client.option.KeyBinding; - -public class VanillaKeybindSuggestions1182 extends VanillaKeybindSuggestions117 { - @Override - protected BindSuggestion newBindSuggestion(KeyBinding bind) { - return new BindSuggestion1182(bind); - } - - @Override - protected KeyBinding[] allKeys(GameOptions options) { - return options.allKeys; - } -} diff --git a/toomanybinds-1.18.2-compat/src/main/resources/fabric.mod.json b/toomanybinds-1.18.2-compat/src/main/resources/fabric.mod.json deleted file mode 100644 index 5a1d5a4..0000000 --- a/toomanybinds-1.18.2-compat/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schemaVersion": 1, - "id": "toomanybinds-compat-1-18-2", - "version": "${version}", - "name": "Too Many Binds 1.18.2 Compat", - "environment": "client", - "entrypoints": { - "main": [ - "com.github.reviversmc.toomanybinds.EntrypointRegistrar1182" - ] - }, - "depends": { - "toomanybinds-compat-1-17": "*" - }, - "custom": { - "modmenu": { - "badges": ["library"], - "parent": { - "id": "toomanybinds" - } - } - } -} diff --git a/toomanybinds-1.19-compat/build.gradle b/toomanybinds-1.19-compat/build.gradle deleted file mode 100644 index f47c9d5..0000000 --- a/toomanybinds-1.19-compat/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - - -archivesBaseName += '-compat-1.19' - - -dependencies { - api project(path: ':toomanybinds-1.18.2-compat', configuration: 'namedElements') - - minecraft "com.mojang:minecraft:${project.minecraft_version_1_19}" - mappings "net.fabricmc:yarn:${project.yarn_mappings_1_19}:v2" - - // Required Fabric API modules - modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version_1_19) - modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version_1_19) - modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version_1_19) - - // Amecs API - modImplementation "de.siphalor:amecsapi-1.19:${project.amecs_api_version_1_19}" - // Nmuk version that is compatible with latest Fabric API - modImplementation "de.siphalor:nmuk-1.19:${project.nmuk_version_1_19}" - - // ModMenu - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version_1_19}" - // Cloth Config - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version_1_19}") { - exclude(group: 'net.fabricmc.fabric-api') - } - - - if (project.use_third_party_mods == 'true') { - configurations { - modRuntimeOnly { - exclude module: 'fabric-lifecycle-events-v1' - exclude module: 'fabric-key-binding-api-v1' - } - } - - modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version_1_19}" - modRuntimeOnly "maven.modrinth:lazydfu:${project.lazydfu_version_1_19}" - modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version_1_19}" - runtimeOnly "org.joml:joml:${project.joml_version_sodium_1_19}" - modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version_1_19}" - modRuntimeOnly "maven.modrinth:starlight:${project.starlight_version_1_19}" - modRuntimeOnly "maven.modrinth:smoothboot-fabric:${project.smoothboot_version_1_19}" - modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version_1_19}" - } -} - - -tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18-pre2 upwards uses Java 17. - it.options.release = 17 -} diff --git a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar119.java b/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar119.java deleted file mode 100644 index 9e8b542..0000000 --- a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar119.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -public class EntrypointRegistrar119 extends EntrypointRegistrarBase { - @Override - public void onInitialize() { - if (isCompatible("1.19", "1.19.2")) { - EntrypointLauncher.setVersionSpecificInitializer(new TooManyBinds119()); - } - } -} diff --git a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds119.java b/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds119.java deleted file mode 100644 index 0efa0cc..0000000 --- a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds119.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions; -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions119; - -public class TooManyBinds119 extends TooManyBinds1182 { - @Override - protected VanillaKeybindSuggestions newVanillaKeyBindSuggestions() { - return new VanillaKeybindSuggestions119(); - } -} diff --git a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion119.java b/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion119.java deleted file mode 100644 index c08887b..0000000 --- a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/BindSuggestion119.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import net.minecraft.client.option.GameOptions; -import net.minecraft.client.option.KeyBinding; -import net.minecraft.text.Text; - -public class BindSuggestion119 extends BindSuggestion1182 { - public BindSuggestion119(KeyBinding bind) { - super(bind); - } - - @Override - protected Text newTranslatableText(String key) { - return Text.translatable(key); - } - - @Override - protected void saveFullscreenState(GameOptions options, boolean fullscreen) { - options.getFullscreen().setValue(fullscreen); - } -} diff --git a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions119.java b/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions119.java deleted file mode 100644 index 1117b54..0000000 --- a/toomanybinds-1.19-compat/src/main/java/com/github/reviversmc/toomanybinds/autocompletion/VanillaKeybindSuggestions119.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.reviversmc.toomanybinds.autocompletion; - -import net.minecraft.client.option.KeyBinding; - -public class VanillaKeybindSuggestions119 extends VanillaKeybindSuggestions1182 { - @Override - protected BindSuggestion newBindSuggestion(KeyBinding bind) { - return new BindSuggestion119(bind); - } -} diff --git a/toomanybinds-1.19-compat/src/main/resources/fabric.mod.json b/toomanybinds-1.19-compat/src/main/resources/fabric.mod.json deleted file mode 100644 index 034bc9b..0000000 --- a/toomanybinds-1.19-compat/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schemaVersion": 1, - "id": "toomanybinds-compat-1-19", - "version": "${version}", - "name": "Too Many Binds 1.19 Compat", - "environment": "client", - "entrypoints": { - "main": [ - "com.github.reviversmc.toomanybinds.EntrypointRegistrar119" - ] - }, - "depends": { - "toomanybinds-compat-1-18-2": "*" - }, - "custom": { - "modmenu": { - "badges": ["library"], - "parent": { - "id": "toomanybinds" - } - } - } -} diff --git a/toomanybinds-1.19.3-compat/build.gradle b/toomanybinds-1.19.3-compat/build.gradle deleted file mode 100644 index 0a3b0b1..0000000 --- a/toomanybinds-1.19.3-compat/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - - -archivesBaseName += '-compat-1.19.3' - - -dependencies { - api project(path: ':toomanybinds-1.19-compat', configuration: 'namedElements') - - minecraft "com.mojang:minecraft:${project.minecraft_version_1_19_3}" - mappings "net.fabricmc:yarn:${project.yarn_mappings_1_19_3}:v2" - - // Required Fabric API modules - modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version_1_19_3) - modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version_1_19_3) - modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version_1_19_3) - - // Amecs API - modImplementation "de.siphalor:amecsapi-1.19:${project.amecs_api_version_1_19_3}" - // Nmuk version that is compatible with latest Fabric API - modImplementation "de.siphalor:nmuk-1.19:${project.nmuk_version_1_19_3}" - - // ModMenu - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version_1_19_3}" - // Cloth Config - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version_1_19_3}") { - exclude(group: 'net.fabricmc.fabric-api') - } - - - if (project.use_third_party_mods == 'true') { - configurations { - modRuntimeOnly { - exclude module: 'fabric-lifecycle-events-v1' - exclude module: 'fabric-key-binding-api-v1' - } - } - - modRuntimeOnly "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version_1_19_3}" - modRuntimeOnly "maven.modrinth:lazydfu:${project.lazydfu_version_1_19_3}" - modRuntimeOnly "maven.modrinth:sodium:${project.sodium_version_1_19_3}" - modRuntimeOnly "maven.modrinth:lithium:${project.lithium_version_1_19_3}" - modRuntimeOnly "maven.modrinth:starlight:${project.starlight_version_1_19_3}" - modRuntimeOnly "maven.modrinth:smoothboot-fabric:${project.smoothboot_version_1_19_3}" - modRuntimeOnly "curse.maven:no-fade-452768:${project.no_fade_version_1_19_3}" - } -} - - -tasks.withType(JavaCompile).configureEach { - // Minecraft 1.18-pre2 upwards uses Java 17. - it.options.release = 17 -} diff --git a/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar1193.java b/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar1193.java deleted file mode 100644 index 3002b7d..0000000 --- a/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrar1193.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -public class EntrypointRegistrar1193 extends EntrypointRegistrarBase { - @Override - public void onInitialize() { - if (isCompatible("1.19.3", INFINITE)) { - EntrypointLauncher.setVersionSpecificInitializer(new TooManyBinds1193()); - } - } -} diff --git a/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen1193.java b/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen1193.java deleted file mode 100644 index cdb3a01..0000000 --- a/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/LauncherScreen1193.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -public class LauncherScreen1193 extends LauncherScreen117 { - @Override - protected void setRepeatKeyboardEvents(boolean repeatEvents) { - // 1.19.3 handles this automatically - } -} diff --git a/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds1193.java b/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds1193.java deleted file mode 100644 index 2fdc773..0000000 --- a/toomanybinds-1.19.3-compat/src/main/java/com/github/reviversmc/toomanybinds/TooManyBinds1193.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import net.minecraft.client.MinecraftClient; - -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions; -import com.github.reviversmc.toomanybinds.autocompletion.VanillaKeybindSuggestions119; - -public class TooManyBinds1193 extends TooManyBinds119 { - @Override - protected VanillaKeybindSuggestions newVanillaKeyBindSuggestions() { - return new VanillaKeybindSuggestions119(); - } - - @Override - protected void openNewLauncherScreen(MinecraftClient client) { - client.setScreen(new LauncherScreen1193()); - } -} diff --git a/toomanybinds-1.19.3-compat/src/main/resources/fabric.mod.json b/toomanybinds-1.19.3-compat/src/main/resources/fabric.mod.json deleted file mode 100644 index d62befd..0000000 --- a/toomanybinds-1.19.3-compat/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "schemaVersion": 1, - "id": "toomanybinds-compat-1-19-3", - "version": "${version}", - "name": "Too Many Binds 1.19.3 Compat", - "environment": "client", - "entrypoints": { - "main": [ - "com.github.reviversmc.toomanybinds.EntrypointRegistrar1193" - ] - }, - "depends": { - "toomanybinds-compat-1-19": "*" - }, - "custom": { - "modmenu": { - "badges": ["library"], - "parent": { - "id": "toomanybinds" - } - } - } -} diff --git a/toomanybinds-core/build.gradle b/toomanybinds-core/build.gradle deleted file mode 100644 index ea29edc..0000000 --- a/toomanybinds-core/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 - - -archivesBaseName += '-core' - - -dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version_1_16}" - mappings "net.fabricmc:yarn:${project.yarn_mappings_1_16}:v2" - - // Required Fabric API modules - modImplementation fabricApi.module('fabric-api-base', project.fabric_api_version_1_16) - modImplementation fabricApi.module('fabric-lifecycle-events-v1', project.fabric_api_version_1_16) - modImplementation fabricApi.module('fabric-key-binding-api-v1', project.fabric_api_version_1_16) - - // Amecs API - modImplementation "de.siphalor:amecsapi-1.16:${project.amecs_api_version_1_16}" - - // ModMenu - modImplementation "com.terraformersmc:modmenu:${project.modmenu_version_1_16}" - // Cloth Config - modImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version_1_16}") { - exclude(group: 'net.fabricmc.fabric-api') - } -} - - -tasks.withType(JavaCompile).configureEach { - it.options.release = 8 -} diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/EntrypointLauncher.java b/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/EntrypointLauncher.java deleted file mode 100644 index 763bb76..0000000 --- a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/EntrypointLauncher.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import net.fabricmc.api.ModInitializer; - -public class EntrypointLauncher implements ModInitializer { - private static ModInitializer versionSpecificInitializer; - private static boolean waitingForInitializerToBeSet; - - public static void setVersionSpecificInitializer(ModInitializer initializer) { - versionSpecificInitializer = initializer; - - if (waitingForInitializerToBeSet) { - waitingForInitializerToBeSet = false; - versionSpecificInitializer.onInitialize(); - } - } - - @Override - public void onInitialize() { - if (versionSpecificInitializer == null) { - waitingForInitializerToBeSet = true; - } else { - versionSpecificInitializer.onInitialize(); - } - } -} diff --git a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrarBase.java b/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrarBase.java deleted file mode 100644 index a6863f9..0000000 --- a/toomanybinds-core/src/main/java/com/github/reviversmc/toomanybinds/EntrypointRegistrarBase.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.github.reviversmc.toomanybinds; - -import net.fabricmc.api.ModInitializer; -import net.fabricmc.loader.api.FabricLoader; -import net.fabricmc.loader.api.Version; -import net.fabricmc.loader.api.VersionParsingException; - -public abstract class EntrypointRegistrarBase implements ModInitializer { - protected static final String INFINITE = "*"; - - protected boolean isCompatible(String inclusiveLowerBounds, String inclusiveUpperBounds) { - boolean compatible = false; - Version mcVersion = FabricLoader.getInstance() - .getModContainer("minecraft") - .get() - .getMetadata() - .getVersion(); - - try { - if (mcVersion.compareTo(Version.parse(inclusiveLowerBounds)) >= 0) { - if (inclusiveUpperBounds.equals(INFINITE) - || mcVersion.compareTo(Version.parse(inclusiveUpperBounds)) <= 0) { - compatible = true; - } - } - } catch (VersionParsingException e) { - // ignored - } - - return compatible; - } -} diff --git a/toomanybinds-core/src/main/resources/fabric.mod.json b/toomanybinds-core/src/main/resources/fabric.mod.json deleted file mode 100644 index 4a0cfa2..0000000 --- a/toomanybinds-core/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "schemaVersion": 1, - "id": "toomanybinds-core", - "version": "${version}", - "name": "Too Many Binds Core", - "environment": "client", - "entrypoints": { - "main": [ - "com.github.reviversmc.toomanybinds.EntrypointLauncher" - ] - }, - "mixins": [ - "toomanybinds.mixins.json" - ], - "depends": { - "minecraft": ">=1.16", - "fabric-lifecycle-events-v1": "*", - "fabric-key-binding-api-v1": "*", - "cloth-config2": ">=4.12.41" - }, - "recommends": { - "amecs": "*" - }, - "custom": { - "modmenu": { - "badges": ["library"], - "parent": { - "id": "toomanybinds" - } - } - } -}