From c14cdffeedc49b6f67aec743ad6c4a11d666a52b Mon Sep 17 00:00:00 2001 From: moonleay Date: Mon, 29 Apr 2024 15:08:02 +0200 Subject: [PATCH] chore: renamed to Gimbal, because I cannot spell apparently Signed-off-by: moonleay --- LICENSE | 4 +- README.md | 2 +- build.gradle.kts | 4 +- gradle.properties | 8 +- .../net/moonleay/{gimble => gimbal}/Main.kt | 14 +-- .../{gimble => gimbal}/client/ClientMain.kt | 18 ++-- .../client/editor/ClientEditor.kt | 88 +++++++++++------- .../client/keybindings/KeybindingManager.kt | 10 +- .../client/keybindings/KeybindingRegistrar.kt | 64 ++++++------- .../keybindings/impl/GimbalShortcut.kt} | 6 +- .../editormode/EnableInsertModeShortcut.kt | 12 +-- .../editormode/EnableReplaceModeShortcut.kt | 12 +-- .../editormode/EnableVisualModeShortcut.kt | 12 +-- .../ToggleBulldozerModifierShortcut.kt | 12 +-- .../ToggleForcePlaceModifierShortcut.kt | 12 +-- .../ToggleNoClipModifierShortcut.kt | 12 +-- .../ToggleNoUpdatesModifierShortcut.kt | 12 +-- .../impl/gamemode/CreativeModeShortcut.kt | 10 +- .../impl/gamemode/SpectatorModeShortcut.kt | 10 +- .../impl/gamemode/SurvivalModeShortcut.kt | 10 +- .../client/util/ChatUtil.kt | 4 +- .../datagen/DataGenerator.kt | 8 +- .../datagen/En_us_GimbalLanguageProvider.kt} | 32 +++---- .../editor/ServerEditorManager.kt | 12 +-- .../editor/state/EditorState.kt | 8 +- .../editor/state/GimbalPolicyType.kt} | 6 +- .../editor/state/mode/Capability.kt | 4 +- .../editor/state/mode/Mode.kt | 4 +- .../editor/state/mode/ModeModifier.kt | 4 +- .../editor/util/EditorUtil.kt | 13 +-- .../editor/util/GimbalPolicy.kt} | 10 +- .../mixin/BulldozerMixin.java | 8 +- .../mixin/BulldozerMixin2.java | 8 +- .../mixin/ForcePlaceMixin.java | 8 +- .../mixin/GimbalPolicyCheckMixin.java} | 8 +- .../{gimble => gimbal}/mixin/HudMixin.java | 6 +- .../mixin/NoBlockUpdatesMixin.java | 8 +- .../mixin/NoClipCameraFixMixin.java | 8 +- .../{gimble => gimbal}/mixin/NoClipMixin.java | 8 +- .../mixin/NormalModeMixin.java | 10 +- .../mixin/ReplaceModeMixin.java | 8 +- .../networking/GimbalClient.kt} | 16 ++-- .../networking/GimbalServer.kt} | 16 ++-- .../networking/PacketIDs.kt | 6 +- .../assets/{gimble => gimbal}/logo.png | Bin src/main/resources/fabric.mod.json | 10 +- ...ble.accesswidener => gimbal.accesswidener} | 0 ...{gimble.mixins.json => gimbal.mixins.json} | 4 +- .../moonleay/gimbal/build/BuildConstants.kt | 25 +++++ .../moonleay/gimble/build/BuildConstants.kt | 7 -- 50 files changed, 322 insertions(+), 279 deletions(-) rename src/main/java/net/moonleay/{gimble => gimbal}/Main.kt (78%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/ClientMain.kt (77%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/editor/ClientEditor.kt (70%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/KeybindingManager.kt (84%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/KeybindingRegistrar.kt (71%) rename src/main/java/net/moonleay/{gimble/client/keybindings/impl/GimbleShortcut.kt => gimbal/client/keybindings/impl/GimbalShortcut.kt} (87%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt (73%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt (73%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt (73%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt (73%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt (73%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt (73%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt (73%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/gamemode/CreativeModeShortcut.kt (78%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt (78%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt (78%) rename src/main/java/net/moonleay/{gimble => gimbal}/client/util/ChatUtil.kt (96%) rename src/main/java/net/moonleay/{gimble => gimbal}/datagen/DataGenerator.kt (88%) rename src/main/java/net/moonleay/{gimble/datagen/En_us_GimbleLanguageProvider.kt => gimbal/datagen/En_us_GimbalLanguageProvider.kt} (60%) rename src/main/java/net/moonleay/{gimble => gimbal}/editor/ServerEditorManager.kt (87%) rename src/main/java/net/moonleay/{gimble => gimbal}/editor/state/EditorState.kt (84%) rename src/main/java/net/moonleay/{gimble/editor/state/GimblePolicyType.kt => gimbal/editor/state/GimbalPolicyType.kt} (90%) rename src/main/java/net/moonleay/{gimble => gimbal}/editor/state/mode/Capability.kt (93%) rename src/main/java/net/moonleay/{gimble => gimbal}/editor/state/mode/Mode.kt (95%) rename src/main/java/net/moonleay/{gimble => gimbal}/editor/state/mode/ModeModifier.kt (94%) rename src/main/java/net/moonleay/{gimble => gimbal}/editor/util/EditorUtil.kt (87%) rename src/main/java/net/moonleay/{gimble/editor/util/GimblePolicy.kt => gimbal/editor/util/GimbalPolicy.kt} (81%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/BulldozerMixin.java (92%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/BulldozerMixin2.java (91%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/ForcePlaceMixin.java (91%) rename src/main/java/net/moonleay/{gimble/mixin/GimblePolicyCheckMixin.java => gimbal/mixin/GimbalPolicyCheckMixin.java} (90%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/HudMixin.java (94%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/NoBlockUpdatesMixin.java (92%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/NoClipCameraFixMixin.java (90%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/NoClipMixin.java (94%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/NormalModeMixin.java (92%) rename src/main/java/net/moonleay/{gimble => gimbal}/mixin/ReplaceModeMixin.java (95%) rename src/main/java/net/moonleay/{gimble/networking/GimbleClient.kt => gimbal/networking/GimbalClient.kt} (83%) rename src/main/java/net/moonleay/{gimble/networking/GimbleServer.kt => gimbal/networking/GimbalServer.kt} (85%) rename src/main/java/net/moonleay/{gimble => gimbal}/networking/PacketIDs.kt (91%) rename src/main/resources/assets/{gimble => gimbal}/logo.png (100%) rename src/main/resources/{gimble.accesswidener => gimbal.accesswidener} (100%) rename src/main/resources/{gimble.mixins.json => gimbal.mixins.json} (83%) create mode 100644 src/main/templates/net/moonleay/gimbal/build/BuildConstants.kt delete mode 100644 src/main/templates/net/moonleay/gimble/build/BuildConstants.kt diff --git a/LICENSE b/LICENSE index 782b415..353ae17 100644 --- a/LICENSE +++ b/LICENSE @@ -631,7 +631,7 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - Gimble + Gimbal Copyright (C) 2024 moonleay This program is free software: you can redistribute it and/or modify @@ -652,7 +652,7 @@ Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - Gimble Copyright (C) 2024 moonleay + Gimbal Copyright (C) 2024 moonleay This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/README.md b/README.md index 2d8dd06..323161a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# The Gimble project +# The Gimbal project This project aims to improve the experience of creating structures in Minecraft. ## Features diff --git a/build.gradle.kts b/build.gradle.kts index 8f67908..60a443d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -30,7 +30,7 @@ plugins { } val mavenVersion = System.getenv("CI_COMMIT_TAG") ?: System.getenv("CI_COMMIT_SHORT_SHA")?.let { "$it-dev" } -?: "0.1.0-dev" //""0.0.0-SNAPSHOT" +?: "0.1.1-dev" //""0.0.0-SNAPSHOT" val modId: String by project val modName: String by project diff --git a/gradle.properties b/gradle.properties index 69381fb..df0fe30 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # -# Gimble +# Gimbal # Copyright (C) 2024 moonleay # # This program is free software: you can redistribute it and/or modify @@ -24,13 +24,13 @@ fabric.api.version=0.77.0+1.19.2 yarn.version=1.19.2+build.28 idea-ext.version=1.1.6 org.gradle.jvmargs=-Xmx2G -modId=gimble +modId=gimbal kotlinx.serialization.version=1.6.2 fabric.kotlin.version=1.10.18+kotlin.1.9.22 mavenGroup=net.moonleay kotlin.code.style=official minecraft.version=1.19.2 -modName=Gimble +modName=Gimbal #fabric.loader.version=0.15.10 -mavenArtifact=gimble +mavenArtifact=gimbal fabric.loader.version=0.14.0 diff --git a/src/main/java/net/moonleay/gimble/Main.kt b/src/main/java/net/moonleay/gimbal/Main.kt similarity index 78% rename from src/main/java/net/moonleay/gimble/Main.kt rename to src/main/java/net/moonleay/gimbal/Main.kt index 8c39ff9..b9fb433 100644 --- a/src/main/java/net/moonleay/gimble/Main.kt +++ b/src/main/java/net/moonleay/gimbal/Main.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,22 +16,22 @@ * along with this program. If not, see . */ -package net.moonleay.gimble +package net.moonleay.gimbal import net.fabricmc.api.ModInitializer -import net.moonleay.gimble.build.BuildConstants -import net.moonleay.gimble.networking.GimbleServer +import net.moonleay.gimbal.build.BuildConstants +import net.moonleay.gimbal.networking.GimbalServer import org.apache.logging.log4j.LogManager internal object Main : ModInitializer { private val LOGGER = LogManager.getLogger(BuildConstants.modName) override fun onInitialize() { - LOGGER.info("Initializing Gimble on the common side...") + LOGGER.info("Initializing Gimbal on the common side...") LOGGER.info("Registering packets...") - GimbleServer.registerPacketHandler() + GimbalServer.registerPacketHandler() LOGGER.info("Packets have been registered.") - LOGGER.info("Gimble has been initialized on the common side.") + LOGGER.info("Gimbal has been initialized on the common side.") LOGGER.info("${BuildConstants.modName} (${BuildConstants.modId}) v.${BuildConstants.modVersion} by moonleay") } } diff --git a/src/main/java/net/moonleay/gimble/client/ClientMain.kt b/src/main/java/net/moonleay/gimbal/client/ClientMain.kt similarity index 77% rename from src/main/java/net/moonleay/gimble/client/ClientMain.kt rename to src/main/java/net/moonleay/gimbal/client/ClientMain.kt index 46de5f6..0d81303 100644 --- a/src/main/java/net/moonleay/gimble/client/ClientMain.kt +++ b/src/main/java/net/moonleay/gimbal/client/ClientMain.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client +package net.moonleay.gimbal.client import net.fabricmc.api.ClientModInitializer import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents -import net.moonleay.gimble.build.BuildConstants -import net.moonleay.gimble.client.keybindings.KeybindingManager -import net.moonleay.gimble.client.keybindings.KeybindingRegistrar -import net.moonleay.gimble.networking.GimbleClient +import net.moonleay.gimbal.build.BuildConstants +import net.moonleay.gimbal.client.keybindings.KeybindingManager +import net.moonleay.gimbal.client.keybindings.KeybindingRegistrar +import net.moonleay.gimbal.networking.GimbalClient import org.apache.logging.log4j.LogManager internal object ClientMain : ClientModInitializer { @@ -31,13 +31,13 @@ internal object ClientMain : ClientModInitializer { override fun onInitializeClient() { - LOGGER.info("Initializing Gimble on the client side...") + LOGGER.info("Initializing Gimbal on the client side...") KeybindingRegistrar.registerKeybindings() registerEvents() LOGGER.info("Registering packets...") - GimbleClient.registerPacketHandlers() + GimbalClient.registerPacketHandlers() LOGGER.info("Packets have been registered.") - LOGGER.info("Gimble has been initialized on the client side.") + LOGGER.info("Gimbal has been initialized on the client side.") } private fun registerEvents() { diff --git a/src/main/java/net/moonleay/gimble/client/editor/ClientEditor.kt b/src/main/java/net/moonleay/gimbal/client/editor/ClientEditor.kt similarity index 70% rename from src/main/java/net/moonleay/gimble/client/editor/ClientEditor.kt rename to src/main/java/net/moonleay/gimbal/client/editor/ClientEditor.kt index 8dc3944..2a732bb 100644 --- a/src/main/java/net/moonleay/gimble/client/editor/ClientEditor.kt +++ b/src/main/java/net/moonleay/gimbal/client/editor/ClientEditor.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,23 +16,23 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.editor +package net.moonleay.gimbal.client.editor import net.minecraft.client.MinecraftClient import net.minecraft.text.Text -import net.moonleay.gimble.client.util.ChatUtil -import net.moonleay.gimble.editor.ServerEditorManager -import net.moonleay.gimble.editor.state.EditorState -import net.moonleay.gimble.editor.state.GimblePolicyType -import net.moonleay.gimble.editor.state.mode.Capability -import net.moonleay.gimble.editor.state.mode.Mode -import net.moonleay.gimble.editor.state.mode.ModeModifier -import net.moonleay.gimble.editor.util.EditorUtil -import net.moonleay.gimble.editor.util.GimblePolicy -import net.moonleay.gimble.networking.GimbleClient +import net.moonleay.gimbal.client.util.ChatUtil +import net.moonleay.gimbal.editor.ServerEditorManager +import net.moonleay.gimbal.editor.state.EditorState +import net.moonleay.gimbal.editor.state.GimbalPolicyType +import net.moonleay.gimbal.editor.state.mode.Capability +import net.moonleay.gimbal.editor.state.mode.Mode +import net.moonleay.gimbal.editor.state.mode.ModeModifier +import net.moonleay.gimbal.editor.util.EditorUtil +import net.moonleay.gimbal.editor.util.GimbalPolicy +import net.moonleay.gimbal.networking.GimbalClient object ClientEditor { - private var POLICY = GimblePolicyType.NOT_PRESENT + private var POLICY = GimbalPolicyType.NOT_PRESENT private var CURRENT_MODE = Mode.NORMAL private var TEMP_DISABLED_MODE = Mode.UNKNOWN @@ -44,35 +44,51 @@ object ClientEditor { fun onConnectedToNewWorld() { - POLICY = GimblePolicyType.NOT_PRESENT - GimbleClient.checkIfServerHasGimble(EditorState(CURRENT_MODE, CURRENT_MODE_MODIFIER)) + POLICY = GimbalPolicyType.NOT_PRESENT + GimbalClient.checkIfServerHasGimble( + EditorState( + CURRENT_MODE, + CURRENT_MODE_MODIFIER + ) + ) if (TEMP_DISABLED_MODE == Mode.UNKNOWN) { - TEMP_DISABLED_MODE = CURRENT_MODE + TEMP_DISABLED_MODE = + CURRENT_MODE } CURRENT_MODE = Mode.INSERT - DISABLED_MODIFIERS_STORAGE.addAll(CURRENT_MODE_MODIFIER) + DISABLED_MODIFIERS_STORAGE.addAll( + CURRENT_MODE_MODIFIER + ) CURRENT_MODE_MODIFIER.clear() } - fun onAllowedCheck(data: GimblePolicy) { + fun onAllowedCheck(data: GimbalPolicy) { POLICY = data.policy - if (data.policy == GimblePolicyType.ALLOWED) { + if (data.policy == GimbalPolicyType.ALLOWED) { if (TEMP_DISABLED_MODE != Mode.UNKNOWN) { - CURRENT_MODE = TEMP_DISABLED_MODE + CURRENT_MODE = + TEMP_DISABLED_MODE TEMP_DISABLED_MODE = Mode.UNKNOWN } - CURRENT_MODE_MODIFIER.addAll(DISABLED_MODIFIERS_STORAGE) + CURRENT_MODE_MODIFIER.addAll( + DISABLED_MODIFIERS_STORAGE + ) DISABLED_MODIFIERS_STORAGE.clear() - this.onUpdated() + onUpdated() } } fun isAllowed(): Boolean { - return POLICY == GimblePolicyType.ALLOWED + return POLICY == GimbalPolicyType.ALLOWED } fun shouldClient(capability: Capability): Boolean { - return EditorUtil.shouldPlayer(capability, EditorState(CURRENT_MODE, CURRENT_MODE_MODIFIER)) + return EditorUtil.shouldPlayer( + capability, EditorState( + CURRENT_MODE, + CURRENT_MODE_MODIFIER + ) + ) } fun isInNonDefaultMode(): Boolean { @@ -83,8 +99,11 @@ object ClientEditor { * Send an updated player state to the server * */ private fun updateServerState() { - val state = EditorState(CURRENT_MODE, CURRENT_MODE_MODIFIER) - GimbleClient.sendEditorState(state) + val state = EditorState( + CURRENT_MODE, + CURRENT_MODE_MODIFIER + ) + GimbalClient.sendEditorState(state) ServerEditorManager.updateEditorState(MinecraftClient.getInstance().player!!.uuid, state) } @@ -101,7 +120,7 @@ object ClientEditor { return CURRENT_MODE = mode - this.onUpdated() + onUpdated() } /* @@ -128,14 +147,14 @@ object ClientEditor { CURRENT_MODE_MODIFIER.add(mod) } - this.onUpdated() + onUpdated() } private fun onUpdated() { CURRENT_MODE_MODIFIER.sortBy { it.displayName } - this.checkForIncompatibleModeModifiers() + checkForIncompatibleModeModifiers() } /** @@ -166,10 +185,13 @@ object ClientEditor { } // Update State - this.updateServerState() + updateServerState() if(TEMP_DISABLED_MODIFIERS.isNotEmpty()) { - ChatUtil.showToastToSelf("${CURRENT_MODE.displayName} Mode disabled", getListAsString(TEMP_DISABLED_MODIFIERS), MinecraftClient.getInstance()) + ChatUtil.showToastToSelf( + "${CURRENT_MODE.displayName} Mode disabled", + getListAsString(TEMP_DISABLED_MODIFIERS), MinecraftClient.getInstance() + ) } } @@ -189,7 +211,7 @@ object ClientEditor { * */ fun getModeDisplayText(): Text { val displayText = StringBuilder(CURRENT_MODE.displayName) - if (CURRENT_MODE_MODIFIER.isNotEmpty() && this.isAllowed() && MinecraftClient.getInstance().player?.isCreative == true) { + if (CURRENT_MODE_MODIFIER.isNotEmpty() && isAllowed() && MinecraftClient.getInstance().player?.isCreative == true) { displayText.append(" [") for (i in CURRENT_MODE_MODIFIER.indices) { displayText.append(CURRENT_MODE_MODIFIER[i].displayName) @@ -198,7 +220,7 @@ object ClientEditor { } } displayText.append("]") - } else if (!this.isAllowed() || !MinecraftClient.getInstance().player?.isCreative!!) { + } else if (!isAllowed() || !MinecraftClient.getInstance().player?.isCreative!!) { displayText.clear() displayText.append("[GIMBLE DISABLED]") } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingManager.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/KeybindingManager.kt similarity index 84% rename from src/main/java/net/moonleay/gimble/client/keybindings/KeybindingManager.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/KeybindingManager.kt index 6ffa816..40e0f2f 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingManager.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/KeybindingManager.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings +package net.moonleay.gimbal.client.keybindings import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl import net.minecraft.client.MinecraftClient -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut object KeybindingManager { - private val shortcuts = mutableListOf() + private val shortcuts = mutableListOf() /** * Register a shortcut. This will also register the keybinding. * */ - fun registerShortcut(shortcut: GimbleShortcut) { + fun registerShortcut(shortcut: GimbalShortcut) { shortcuts.add(shortcut) KeyBindingRegistryImpl.registerKeyBinding(shortcut.keyBinding) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingRegistrar.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/KeybindingRegistrar.kt similarity index 71% rename from src/main/java/net/moonleay/gimble/client/keybindings/KeybindingRegistrar.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/KeybindingRegistrar.kt index 80f7b4b..83a0e6d 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingRegistrar.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/KeybindingRegistrar.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,20 +16,20 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings +package net.moonleay.gimbal.client.keybindings import net.minecraft.client.option.KeyBinding import net.minecraft.client.util.InputUtil -import net.moonleay.gimble.build.BuildConstants -import net.moonleay.gimble.client.keybindings.impl.editormode.EnableInsertModeShortcut -import net.moonleay.gimble.client.keybindings.impl.editormode.EnableReplaceModeShortcut -import net.moonleay.gimble.client.keybindings.impl.editormodemodifier.ToggleBulldozerModifierShortcut -import net.moonleay.gimble.client.keybindings.impl.editormodemodifier.ToggleForcePlaceModifierShortcut -import net.moonleay.gimble.client.keybindings.impl.editormodemodifier.ToggleNoClipModifierShortcut -import net.moonleay.gimble.client.keybindings.impl.editormodemodifier.ToggleNoUpdatesModifierShortcut -import net.moonleay.gimble.client.keybindings.impl.gamemode.CreativeModeShortcut -import net.moonleay.gimble.client.keybindings.impl.gamemode.SpectatorModeShortcut -import net.moonleay.gimble.client.keybindings.impl.gamemode.SurvivalModeShortcut +import net.moonleay.gimbal.build.BuildConstants +import net.moonleay.gimbal.client.keybindings.impl.editormode.EnableInsertModeShortcut +import net.moonleay.gimbal.client.keybindings.impl.editormode.EnableReplaceModeShortcut +import net.moonleay.gimbal.client.keybindings.impl.editormodemodifier.ToggleBulldozerModifierShortcut +import net.moonleay.gimbal.client.keybindings.impl.editormodemodifier.ToggleForcePlaceModifierShortcut +import net.moonleay.gimbal.client.keybindings.impl.editormodemodifier.ToggleNoClipModifierShortcut +import net.moonleay.gimbal.client.keybindings.impl.editormodemodifier.ToggleNoUpdatesModifierShortcut +import net.moonleay.gimbal.client.keybindings.impl.gamemode.CreativeModeShortcut +import net.moonleay.gimbal.client.keybindings.impl.gamemode.SpectatorModeShortcut +import net.moonleay.gimbal.client.keybindings.impl.gamemode.SurvivalModeShortcut import org.apache.logging.log4j.LogManager import org.lwjgl.glfw.GLFW @@ -47,28 +47,28 @@ object KeybindingRegistrar { private fun registerSetEditorModeModifierKeybindings() { val toggleBulldozerModifierShortcut = KeyBinding( - "gimble.key.editor.modifier.bulldozer", + "gimbal.key.editor.modifier.bulldozer", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, - "gimble.category.editormodifier" + "gimbal.category.editormodifier" ) val toggleForcePlaceModifierShortcut = KeyBinding( - "gimble.key.editor.modifier.forceplace", + "gimbal.key.editor.modifier.forceplace", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, - "gimble.category.editormodifier" + "gimbal.category.editormodifier" ) val toggleNoUpdatesModifierShortcut = KeyBinding( - "gimble.key.editor.modifier.noupdates", + "gimbal.key.editor.modifier.noupdates", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, - "gimble.category.editormodifier" + "gimbal.category.editormodifier" ) val toggleNoClipModifierShortcut = KeyBinding( - "gimble.key.editor.modifier.noclip", + "gimbal.key.editor.modifier.noclip", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, - "gimble.category.editormodifier" + "gimbal.category.editormodifier" ) KeybindingManager.registerShortcut(ToggleBulldozerModifierShortcut(toggleBulldozerModifierShortcut)) @@ -79,22 +79,22 @@ object KeybindingRegistrar { private fun registerSetEditorModeKeybindings() { val insertKeyBinding = KeyBinding( - "gimble.key.editor.mode.insert", + "gimbal.key.editor.mode.insert", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_I, - "gimble.category.editormode" + "gimbal.category.editormode" ) val replaceKeyBinding = KeyBinding( - "gimble.key.editor.mode.replace", + "gimbal.key.editor.mode.replace", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_R, - "gimble.category.editormode" + "gimbal.category.editormode" ) // val visualKeyBinding = KeyBinding( -// "gimble.key.editor.mode.visual", +// "gimbal.key.editor.mode.visual", // InputUtil.Type.KEYSYM, // GLFW.GLFW_KEY_V, -// "gimble.category.editormode" +// "gimbal.category.editormode" // ) KeybindingManager.registerShortcut(EnableInsertModeShortcut(insertKeyBinding)) KeybindingManager.registerShortcut(EnableReplaceModeShortcut(replaceKeyBinding)) @@ -103,22 +103,22 @@ object KeybindingRegistrar { private fun registerSetGameModeKeybindings() { val survivalKeyBinding = KeyBinding( - "gimble.key.game.mode.survival", + "gimbal.key.game.mode.survival", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, - "gimble.category.gamemode" + "gimbal.category.gamemode" ) val creativeKeyBinding = KeyBinding( - "gimble.key.game.mode.creative", + "gimbal.key.game.mode.creative", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, - "gimble.category.gamemode" + "gimbal.category.gamemode" ) val spectatorKeyBinding = KeyBinding( - "gimble.key.game.mode.spectator", + "gimbal.key.game.mode.spectator", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, - "gimble.category.gamemode" + "gimbal.category.gamemode" ) KeybindingManager.registerShortcut(SurvivalModeShortcut(survivalKeyBinding)) KeybindingManager.registerShortcut(CreativeModeShortcut(creativeKeyBinding)) diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/GimbleShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/GimbalShortcut.kt similarity index 87% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/GimbleShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/GimbalShortcut.kt index aec8825..fd7f299 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/GimbleShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/GimbalShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl +package net.moonleay.gimbal.client.keybindings.impl import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -abstract class GimbleShortcut(val keyBinding: KeyBinding) { +abstract class GimbalShortcut(val keyBinding: KeyBinding) { abstract fun onPressed(client: MinecraftClient) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt similarity index 73% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt index cbee6b9..31208c9 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.editormode +package net.moonleay.gimbal.client.keybindings.impl.editormode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.editor.state.mode.Mode +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.editor.state.mode.Mode -class EnableInsertModeShortcut(key: KeyBinding): GimbleShortcut(key) { +class EnableInsertModeShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ClientEditor.setMode(Mode.INSERT) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt similarity index 73% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt index 805e5a2..bfee8c7 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.editormode +package net.moonleay.gimbal.client.keybindings.impl.editormode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.editor.state.mode.Mode +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.editor.state.mode.Mode -class EnableReplaceModeShortcut(key: KeyBinding): GimbleShortcut(key) { +class EnableReplaceModeShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ClientEditor.setMode(Mode.REPLACE) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt similarity index 73% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt index 3d25e84..26136a0 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,16 +16,16 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.editormode +package net.moonleay.gimbal.client.keybindings.impl.editormode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.editor.state.mode.Mode +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.editor.state.mode.Mode -class EnableVisualModeShortcut(key: KeyBinding): GimbleShortcut(key) { +class EnableVisualModeShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ClientEditor.setMode(Mode.VISUAL) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt similarity index 73% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt index affa660..6ca9306 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimbal.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.editor.state.mode.ModeModifier +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.editor.state.mode.ModeModifier -class ToggleBulldozerModifierShortcut(key: KeyBinding): GimbleShortcut(key) { +class ToggleBulldozerModifierShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ClientEditor.toggleModifier(ModeModifier.BULLDOZER) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt similarity index 73% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt index f5b11d0..18c7ce3 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimbal.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.editor.state.mode.ModeModifier +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.editor.state.mode.ModeModifier -class ToggleForcePlaceModifierShortcut(key: KeyBinding): GimbleShortcut(key) { +class ToggleForcePlaceModifierShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ClientEditor.toggleModifier(ModeModifier.FORCE_PLACE) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt similarity index 73% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt index 53e2f9d..0d23bab 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimbal.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.editor.state.mode.ModeModifier +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.editor.state.mode.ModeModifier -class ToggleNoClipModifierShortcut(key: KeyBinding): GimbleShortcut(key) { +class ToggleNoClipModifierShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ClientEditor.toggleModifier(ModeModifier.NO_CLIP) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt similarity index 73% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt index c431bd6..960e031 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimbal.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.editor.state.mode.ModeModifier +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.editor.state.mode.ModeModifier -class ToggleNoUpdatesModifierShortcut(key: KeyBinding): GimbleShortcut(key) { +class ToggleNoUpdatesModifierShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ClientEditor.toggleModifier(ModeModifier.NO_UPDATES) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/CreativeModeShortcut.kt similarity index 78% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/CreativeModeShortcut.kt index a883304..11c9edf 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/CreativeModeShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.gamemode +package net.moonleay.gimbal.client.keybindings.impl.gamemode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.client.util.ChatUtil +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.client.util.ChatUtil -class CreativeModeShortcut(key: KeyBinding): GimbleShortcut(key) { +class CreativeModeShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ChatUtil.sendCommand("/gamemode creative", client, false) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt similarity index 78% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt index 7acdc65..599d163 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.gamemode +package net.moonleay.gimbal.client.keybindings.impl.gamemode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.client.util.ChatUtil +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.client.util.ChatUtil -class SpectatorModeShortcut(key: KeyBinding): GimbleShortcut(key) { +class SpectatorModeShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ChatUtil.sendCommand("/gamemode spectator", client, false) } diff --git a/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt similarity index 78% rename from src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt rename to src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt index 60f6b51..c14a4ae 100644 --- a/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt +++ b/src/main/java/net/moonleay/gimbal/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,15 +16,15 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.keybindings.impl.gamemode +package net.moonleay.gimbal.client.keybindings.impl.gamemode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.gimble.client.util.ChatUtil +import net.moonleay.gimbal.client.keybindings.impl.GimbalShortcut +import net.moonleay.gimbal.client.util.ChatUtil -class SurvivalModeShortcut(key: KeyBinding) : GimbleShortcut(key) { +class SurvivalModeShortcut(key: KeyBinding) : GimbalShortcut(key) { override fun onPressed(client: MinecraftClient) { ChatUtil.sendCommand("/gamemode survival", client, false) diff --git a/src/main/java/net/moonleay/gimble/client/util/ChatUtil.kt b/src/main/java/net/moonleay/gimbal/client/util/ChatUtil.kt similarity index 96% rename from src/main/java/net/moonleay/gimble/client/util/ChatUtil.kt rename to src/main/java/net/moonleay/gimbal/client/util/ChatUtil.kt index e0922b8..9fd2b18 100644 --- a/src/main/java/net/moonleay/gimble/client/util/ChatUtil.kt +++ b/src/main/java/net/moonleay/gimbal/client/util/ChatUtil.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.client.util +package net.moonleay.gimbal.client.util import net.minecraft.client.MinecraftClient import net.minecraft.client.toast.SystemToast diff --git a/src/main/java/net/moonleay/gimble/datagen/DataGenerator.kt b/src/main/java/net/moonleay/gimbal/datagen/DataGenerator.kt similarity index 88% rename from src/main/java/net/moonleay/gimble/datagen/DataGenerator.kt rename to src/main/java/net/moonleay/gimbal/datagen/DataGenerator.kt index 2bfd24e..b328d97 100644 --- a/src/main/java/net/moonleay/gimble/datagen/DataGenerator.kt +++ b/src/main/java/net/moonleay/gimbal/datagen/DataGenerator.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.datagen +package net.moonleay.gimbal.datagen import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator -import net.moonleay.gimble.build.BuildConstants +import net.moonleay.gimbal.build.BuildConstants import org.apache.logging.log4j.LogManager internal class DataGenerator : DataGeneratorEntrypoint { @@ -28,6 +28,6 @@ internal class DataGenerator : DataGeneratorEntrypoint { override fun onInitializeDataGenerator(fabricDataGenerator: FabricDataGenerator) { LOGGER.info("Starting Data Generation") - fabricDataGenerator.addProvider(En_us_GimbleLanguageProvider(fabricDataGenerator)) + fabricDataGenerator.addProvider(En_us_GimbalLanguageProvider(fabricDataGenerator)) } } diff --git a/src/main/java/net/moonleay/gimble/datagen/En_us_GimbleLanguageProvider.kt b/src/main/java/net/moonleay/gimbal/datagen/En_us_GimbalLanguageProvider.kt similarity index 60% rename from src/main/java/net/moonleay/gimble/datagen/En_us_GimbleLanguageProvider.kt rename to src/main/java/net/moonleay/gimbal/datagen/En_us_GimbalLanguageProvider.kt index 65207dc..34d0fce 100644 --- a/src/main/java/net/moonleay/gimble/datagen/En_us_GimbleLanguageProvider.kt +++ b/src/main/java/net/moonleay/gimbal/datagen/En_us_GimbalLanguageProvider.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,35 +16,35 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.datagen +package net.moonleay.gimbal.datagen import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider -class En_us_GimbleLanguageProvider(dataGenerator: FabricDataGenerator?) : +class En_us_GimbalLanguageProvider(dataGenerator: FabricDataGenerator?) : FabricLanguageProvider(dataGenerator, "en_us") { override fun generateTranslations(translationBuilder: TranslationBuilder?) { if (translationBuilder == null) return // Editor modes - translationBuilder.add("gimble.category.editormode", "Editor Modes") - translationBuilder.add("gimble.key.editor.mode.insert", "Enter Insert Mode") - translationBuilder.add("gimble.key.editor.mode.replace", "Enter Replace Mode") - translationBuilder.add("gimble.key.editor.mode.visual", "Enter Visual Mode") + translationBuilder.add("gimbal.category.editormode", "Editor Modes") + translationBuilder.add("gimbal.key.editor.mode.insert", "Enter Insert Mode") + translationBuilder.add("gimbal.key.editor.mode.replace", "Enter Replace Mode") + translationBuilder.add("gimbal.key.editor.mode.visual", "Enter Visual Mode") // Editor mode modifiers - translationBuilder.add("gimble.category.editormodifier", "Editor Mode Modifiers") - translationBuilder.add("gimble.key.editor.modifier.bulldozer", "Toggle Bulldozer Modifier") - translationBuilder.add("gimble.key.editor.modifier.forceplace", "Toggle Force Place Modifier") - translationBuilder.add("gimble.key.editor.modifier.noupdates", "Toggle No Updates Modifier") - translationBuilder.add("gimble.key.editor.modifier.noclip", "Toggle No Clip Modifier") + translationBuilder.add("gimbal.category.editormodifier", "Editor Mode Modifiers") + translationBuilder.add("gimbal.key.editor.modifier.bulldozer", "Toggle Bulldozer Modifier") + translationBuilder.add("gimbal.key.editor.modifier.forceplace", "Toggle Force Place Modifier") + translationBuilder.add("gimbal.key.editor.modifier.noupdates", "Toggle No Updates Modifier") + translationBuilder.add("gimbal.key.editor.modifier.noclip", "Toggle No Clip Modifier") // Game mode - translationBuilder.add("gimble.category.gamemode", "Game Mode") - translationBuilder.add("gimble.key.game.mode.survival", "Enable Survival Mode") - translationBuilder.add("gimble.key.game.mode.creative", "Enable Creative Mode") - translationBuilder.add("gimble.key.game.mode.spectator", "Enable Spectator Mode") + translationBuilder.add("gimbal.category.gamemode", "Game Mode") + translationBuilder.add("gimbal.key.game.mode.survival", "Enable Survival Mode") + translationBuilder.add("gimbal.key.game.mode.creative", "Enable Creative Mode") + translationBuilder.add("gimbal.key.game.mode.spectator", "Enable Spectator Mode") } } diff --git a/src/main/java/net/moonleay/gimble/editor/ServerEditorManager.kt b/src/main/java/net/moonleay/gimbal/editor/ServerEditorManager.kt similarity index 87% rename from src/main/java/net/moonleay/gimble/editor/ServerEditorManager.kt rename to src/main/java/net/moonleay/gimbal/editor/ServerEditorManager.kt index 66f5b7d..5bb3f96 100644 --- a/src/main/java/net/moonleay/gimble/editor/ServerEditorManager.kt +++ b/src/main/java/net/moonleay/gimbal/editor/ServerEditorManager.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor +package net.moonleay.gimbal.editor -import net.moonleay.gimble.build.BuildConstants -import net.moonleay.gimble.editor.state.EditorState -import net.moonleay.gimble.editor.state.mode.Capability -import net.moonleay.gimble.editor.util.EditorUtil +import net.moonleay.gimbal.build.BuildConstants +import net.moonleay.gimbal.editor.state.EditorState +import net.moonleay.gimbal.editor.state.mode.Capability +import net.moonleay.gimbal.editor.util.EditorUtil import org.apache.logging.log4j.LogManager import java.util.* diff --git a/src/main/java/net/moonleay/gimble/editor/state/EditorState.kt b/src/main/java/net/moonleay/gimbal/editor/state/EditorState.kt similarity index 84% rename from src/main/java/net/moonleay/gimble/editor/state/EditorState.kt rename to src/main/java/net/moonleay/gimbal/editor/state/EditorState.kt index 999c42a..bda6a97 100644 --- a/src/main/java/net/moonleay/gimble/editor/state/EditorState.kt +++ b/src/main/java/net/moonleay/gimbal/editor/state/EditorState.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,11 +16,11 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor.state +package net.moonleay.gimbal.editor.state import kotlinx.serialization.Serializable -import net.moonleay.gimble.editor.state.mode.Mode -import net.moonleay.gimble.editor.state.mode.ModeModifier +import net.moonleay.gimbal.editor.state.mode.Mode +import net.moonleay.gimbal.editor.state.mode.ModeModifier @Serializable data class EditorState( diff --git a/src/main/java/net/moonleay/gimble/editor/state/GimblePolicyType.kt b/src/main/java/net/moonleay/gimbal/editor/state/GimbalPolicyType.kt similarity index 90% rename from src/main/java/net/moonleay/gimble/editor/state/GimblePolicyType.kt rename to src/main/java/net/moonleay/gimbal/editor/state/GimbalPolicyType.kt index b028590..cf045be 100644 --- a/src/main/java/net/moonleay/gimble/editor/state/GimblePolicyType.kt +++ b/src/main/java/net/moonleay/gimbal/editor/state/GimbalPolicyType.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,9 +16,9 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor.state +package net.moonleay.gimbal.editor.state -enum class GimblePolicyType { +enum class GimbalPolicyType { ALLOWED, DENIED, NOT_PRESENT diff --git a/src/main/java/net/moonleay/gimble/editor/state/mode/Capability.kt b/src/main/java/net/moonleay/gimbal/editor/state/mode/Capability.kt similarity index 93% rename from src/main/java/net/moonleay/gimble/editor/state/mode/Capability.kt rename to src/main/java/net/moonleay/gimbal/editor/state/mode/Capability.kt index 2864670..bc8a055 100644 --- a/src/main/java/net/moonleay/gimble/editor/state/mode/Capability.kt +++ b/src/main/java/net/moonleay/gimbal/editor/state/mode/Capability.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor.state.mode +package net.moonleay.gimbal.editor.state.mode enum class Capability { INSERT, diff --git a/src/main/java/net/moonleay/gimble/editor/state/mode/Mode.kt b/src/main/java/net/moonleay/gimbal/editor/state/mode/Mode.kt similarity index 95% rename from src/main/java/net/moonleay/gimble/editor/state/mode/Mode.kt rename to src/main/java/net/moonleay/gimbal/editor/state/mode/Mode.kt index 1962107..157cfa3 100644 --- a/src/main/java/net/moonleay/gimble/editor/state/mode/Mode.kt +++ b/src/main/java/net/moonleay/gimbal/editor/state/mode/Mode.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor.state.mode +package net.moonleay.gimbal.editor.state.mode enum class Mode(val displayName: String, val color: Int, val incompatibleModifiers: List){ UNKNOWN("UNKNOWN", 0x000000, listOf()), // Unknown mode. This mode cannot be entered diff --git a/src/main/java/net/moonleay/gimble/editor/state/mode/ModeModifier.kt b/src/main/java/net/moonleay/gimbal/editor/state/mode/ModeModifier.kt similarity index 94% rename from src/main/java/net/moonleay/gimble/editor/state/mode/ModeModifier.kt rename to src/main/java/net/moonleay/gimbal/editor/state/mode/ModeModifier.kt index ff59dad..221941f 100644 --- a/src/main/java/net/moonleay/gimble/editor/state/mode/ModeModifier.kt +++ b/src/main/java/net/moonleay/gimbal/editor/state/mode/ModeModifier.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor.state.mode +package net.moonleay.gimbal.editor.state.mode enum class ModeModifier(val displayName: String) { // NONE("None"), // No Modifiers - default behavior diff --git a/src/main/java/net/moonleay/gimble/editor/util/EditorUtil.kt b/src/main/java/net/moonleay/gimbal/editor/util/EditorUtil.kt similarity index 87% rename from src/main/java/net/moonleay/gimble/editor/util/EditorUtil.kt rename to src/main/java/net/moonleay/gimbal/editor/util/EditorUtil.kt index 7e0312b..55b3c52 100644 --- a/src/main/java/net/moonleay/gimble/editor/util/EditorUtil.kt +++ b/src/main/java/net/moonleay/gimbal/editor/util/EditorUtil.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,12 +16,13 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor.util +package net.moonleay.gimbal.editor.util + +import net.moonleay.gimbal.editor.state.EditorState +import net.moonleay.gimbal.editor.state.mode.Capability +import net.moonleay.gimbal.editor.state.mode.Mode +import net.moonleay.gimbal.editor.state.mode.ModeModifier -import net.moonleay.gimble.editor.state.EditorState -import net.moonleay.gimble.editor.state.mode.Capability -import net.moonleay.gimble.editor.state.mode.Mode -import net.moonleay.gimble.editor.state.mode.ModeModifier object EditorUtil { diff --git a/src/main/java/net/moonleay/gimble/editor/util/GimblePolicy.kt b/src/main/java/net/moonleay/gimbal/editor/util/GimbalPolicy.kt similarity index 81% rename from src/main/java/net/moonleay/gimble/editor/util/GimblePolicy.kt rename to src/main/java/net/moonleay/gimbal/editor/util/GimbalPolicy.kt index 28c79e8..1d4e5ce 100644 --- a/src/main/java/net/moonleay/gimble/editor/util/GimblePolicy.kt +++ b/src/main/java/net/moonleay/gimbal/editor/util/GimbalPolicy.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.editor.util +package net.moonleay.gimbal.editor.util import kotlinx.serialization.Serializable -import net.moonleay.gimble.editor.state.GimblePolicyType +import net.moonleay.gimbal.editor.state.GimbalPolicyType @Serializable -data class GimblePolicy( - val policy: GimblePolicyType, +data class GimbalPolicy( + val policy: GimbalPolicyType, ) diff --git a/src/main/java/net/moonleay/gimble/mixin/BulldozerMixin.java b/src/main/java/net/moonleay/gimbal/mixin/BulldozerMixin.java similarity index 92% rename from src/main/java/net/moonleay/gimble/mixin/BulldozerMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/BulldozerMixin.java index dd6ffb4..a89604a 100644 --- a/src/main/java/net/moonleay/gimble/mixin/BulldozerMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/BulldozerMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; -import net.moonleay.gimble.client.editor.ClientEditor; -import net.moonleay.gimble.editor.state.mode.Capability; +import net.moonleay.gimbal.client.editor.ClientEditor; +import net.moonleay.gimbal.editor.state.mode.Capability; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/src/main/java/net/moonleay/gimble/mixin/BulldozerMixin2.java b/src/main/java/net/moonleay/gimbal/mixin/BulldozerMixin2.java similarity index 91% rename from src/main/java/net/moonleay/gimble/mixin/BulldozerMixin2.java rename to src/main/java/net/moonleay/gimbal/mixin/BulldozerMixin2.java index 89b27f8..19f1378 100644 --- a/src/main/java/net/moonleay/gimble/mixin/BulldozerMixin2.java +++ b/src/main/java/net/moonleay/gimbal/mixin/BulldozerMixin2.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerInteractionManager; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.moonleay.gimble.client.editor.ClientEditor; -import net.moonleay.gimble.editor.state.mode.Capability; +import net.moonleay.gimbal.client.editor.ClientEditor; +import net.moonleay.gimbal.editor.state.mode.Capability; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/src/main/java/net/moonleay/gimble/mixin/ForcePlaceMixin.java b/src/main/java/net/moonleay/gimbal/mixin/ForcePlaceMixin.java similarity index 91% rename from src/main/java/net/moonleay/gimble/mixin/ForcePlaceMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/ForcePlaceMixin.java index f9d2bc5..042d704 100644 --- a/src/main/java/net/moonleay/gimble/mixin/ForcePlaceMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/ForcePlaceMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemPlacementContext; -import net.moonleay.gimble.editor.ServerEditorManager; -import net.moonleay.gimble.editor.state.mode.Capability; +import net.moonleay.gimbal.editor.ServerEditorManager; +import net.moonleay.gimbal.editor.state.mode.Capability; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/net/moonleay/gimble/mixin/GimblePolicyCheckMixin.java b/src/main/java/net/moonleay/gimbal/mixin/GimbalPolicyCheckMixin.java similarity index 90% rename from src/main/java/net/moonleay/gimble/mixin/GimblePolicyCheckMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/GimbalPolicyCheckMixin.java index 0568cca..637f13d 100644 --- a/src/main/java/net/moonleay/gimble/mixin/GimblePolicyCheckMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/GimbalPolicyCheckMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,17 +16,17 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.client.gui.screen.DownloadingTerrainScreen; -import net.moonleay.gimble.client.editor.ClientEditor; +import net.moonleay.gimbal.client.editor.ClientEditor; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(DownloadingTerrainScreen.class) -public class GimblePolicyCheckMixin { +public class GimbalPolicyCheckMixin { @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen;close()V", ordinal = -1)) diff --git a/src/main/java/net/moonleay/gimble/mixin/HudMixin.java b/src/main/java/net/moonleay/gimbal/mixin/HudMixin.java similarity index 94% rename from src/main/java/net/moonleay/gimble/mixin/HudMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/HudMixin.java index ed41ba4..fab79b6 100644 --- a/src/main/java/net/moonleay/gimble/mixin/HudMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/HudMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,13 +16,13 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.hud.InGameHud; import net.minecraft.client.util.math.MatrixStack; -import net.moonleay.gimble.client.editor.ClientEditor; +import net.moonleay.gimbal.client.editor.ClientEditor; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/src/main/java/net/moonleay/gimble/mixin/NoBlockUpdatesMixin.java b/src/main/java/net/moonleay/gimbal/mixin/NoBlockUpdatesMixin.java similarity index 92% rename from src/main/java/net/moonleay/gimble/mixin/NoBlockUpdatesMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/NoBlockUpdatesMixin.java index e2ffeec..9fec1e5 100644 --- a/src/main/java/net/moonleay/gimble/mixin/NoBlockUpdatesMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/NoBlockUpdatesMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.item.BlockItem; import net.minecraft.item.ItemPlacementContext; -import net.moonleay.gimble.editor.ServerEditorManager; -import net.moonleay.gimble.editor.state.mode.Capability; +import net.moonleay.gimbal.editor.ServerEditorManager; +import net.moonleay.gimbal.editor.state.mode.Capability; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/net/moonleay/gimble/mixin/NoClipCameraFixMixin.java b/src/main/java/net/moonleay/gimbal/mixin/NoClipCameraFixMixin.java similarity index 90% rename from src/main/java/net/moonleay/gimble/mixin/NoClipCameraFixMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/NoClipCameraFixMixin.java index f2b7c43..55a8882 100644 --- a/src/main/java/net/moonleay/gimble/mixin/NoClipCameraFixMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/NoClipCameraFixMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,12 +16,12 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.Camera; -import net.moonleay.gimble.client.editor.ClientEditor; -import net.moonleay.gimble.editor.state.mode.Capability; +import net.moonleay.gimbal.client.editor.ClientEditor; +import net.moonleay.gimbal.editor.state.mode.Capability; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/java/net/moonleay/gimble/mixin/NoClipMixin.java b/src/main/java/net/moonleay/gimbal/mixin/NoClipMixin.java similarity index 94% rename from src/main/java/net/moonleay/gimble/mixin/NoClipMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/NoClipMixin.java index de2eda3..fafab39 100644 --- a/src/main/java/net/moonleay/gimble/mixin/NoClipMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/NoClipMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import com.mojang.authlib.GameProfile; import net.minecraft.entity.EntityPose; @@ -25,8 +25,8 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerAbilities; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.world.World; -import net.moonleay.gimble.editor.ServerEditorManager; -import net.moonleay.gimble.editor.state.mode.Capability; +import net.moonleay.gimbal.editor.ServerEditorManager; +import net.moonleay.gimbal.editor.state.mode.Capability; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; diff --git a/src/main/java/net/moonleay/gimble/mixin/NormalModeMixin.java b/src/main/java/net/moonleay/gimbal/mixin/NormalModeMixin.java similarity index 92% rename from src/main/java/net/moonleay/gimble/mixin/NormalModeMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/NormalModeMixin.java index e1e4e49..7dc6232 100644 --- a/src/main/java/net/moonleay/gimble/mixin/NormalModeMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/NormalModeMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,14 +16,14 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.option.GameOptions; -import net.moonleay.gimble.client.editor.ClientEditor; -import net.moonleay.gimble.editor.state.mode.Capability; -import net.moonleay.gimble.editor.state.mode.Mode; +import net.moonleay.gimbal.client.editor.ClientEditor; +import net.moonleay.gimbal.editor.state.mode.Capability; +import net.moonleay.gimbal.editor.state.mode.Mode; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/src/main/java/net/moonleay/gimble/mixin/ReplaceModeMixin.java b/src/main/java/net/moonleay/gimbal/mixin/ReplaceModeMixin.java similarity index 95% rename from src/main/java/net/moonleay/gimble/mixin/ReplaceModeMixin.java rename to src/main/java/net/moonleay/gimbal/mixin/ReplaceModeMixin.java index 8e61fa0..477b86d 100644 --- a/src/main/java/net/moonleay/gimble/mixin/ReplaceModeMixin.java +++ b/src/main/java/net/moonleay/gimbal/mixin/ReplaceModeMixin.java @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.mixin; +package net.moonleay.gimbal.mixin; import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; @@ -29,8 +29,8 @@ import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import net.moonleay.gimble.client.editor.ClientEditor; -import net.moonleay.gimble.editor.state.mode.Capability; +import net.moonleay.gimbal.client.editor.ClientEditor; +import net.moonleay.gimbal.editor.state.mode.Capability; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/main/java/net/moonleay/gimble/networking/GimbleClient.kt b/src/main/java/net/moonleay/gimbal/networking/GimbalClient.kt similarity index 83% rename from src/main/java/net/moonleay/gimble/networking/GimbleClient.kt rename to src/main/java/net/moonleay/gimbal/networking/GimbalClient.kt index 195f1fb..c2b154a 100644 --- a/src/main/java/net/moonleay/gimble/networking/GimbleClient.kt +++ b/src/main/java/net/moonleay/gimbal/networking/GimbalClient.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.networking +package net.moonleay.gimbal.networking import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.cbor.Cbor @@ -25,11 +25,11 @@ import kotlinx.serialization.encodeToByteArray import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking import net.fabricmc.fabric.api.networking.v1.PacketByteBufs import net.minecraft.network.PacketByteBuf -import net.moonleay.gimble.client.editor.ClientEditor -import net.moonleay.gimble.editor.state.EditorState -import net.moonleay.gimble.editor.util.GimblePolicy +import net.moonleay.gimbal.client.editor.ClientEditor +import net.moonleay.gimbal.editor.state.EditorState +import net.moonleay.gimbal.editor.util.GimbalPolicy -object GimbleClient { +object GimbalClient { fun registerPacketHandlers() { ClientPlayNetworking.registerGlobalReceiver(PacketIDs.TRANSFER_GIMBLE_POLICY_ID) { _, _, buf, _ -> @@ -37,8 +37,9 @@ object GimbleClient { } } + @OptIn(ExperimentalSerializationApi::class) private fun onAllowedCheck(buf: PacketByteBuf) { - val policy = Cbor.decodeFromByteArray(buf.readByteArray()) + val policy = Cbor.decodeFromByteArray(buf.readByteArray()) ClientEditor.onAllowedCheck(policy) // Update the client's policy } @@ -52,6 +53,7 @@ object GimbleClient { ClientPlayNetworking.send(PacketIDs.UPDATE_EDITOR_STATE_ID, buf) } + @OptIn(ExperimentalSerializationApi::class) fun checkIfServerHasGimble(state: EditorState) { val buf = PacketByteBufs.create() buf.writeByteArray(Cbor.encodeToByteArray(state)) diff --git a/src/main/java/net/moonleay/gimble/networking/GimbleServer.kt b/src/main/java/net/moonleay/gimbal/networking/GimbalServer.kt similarity index 85% rename from src/main/java/net/moonleay/gimble/networking/GimbleServer.kt rename to src/main/java/net/moonleay/gimbal/networking/GimbalServer.kt index ef52acf..7ba0d38 100644 --- a/src/main/java/net/moonleay/gimble/networking/GimbleServer.kt +++ b/src/main/java/net/moonleay/gimbal/networking/GimbalServer.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,7 +16,7 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.networking +package net.moonleay.gimbal.networking import kotlinx.serialization.cbor.Cbor import kotlinx.serialization.decodeFromByteArray @@ -25,12 +25,12 @@ import net.fabricmc.fabric.api.networking.v1.PacketByteBufs import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking import net.minecraft.network.PacketByteBuf import net.minecraft.server.network.ServerPlayerEntity -import net.moonleay.gimble.editor.ServerEditorManager -import net.moonleay.gimble.editor.state.EditorState -import net.moonleay.gimble.editor.state.GimblePolicyType -import net.moonleay.gimble.editor.util.GimblePolicy +import net.moonleay.gimbal.editor.ServerEditorManager +import net.moonleay.gimbal.editor.state.EditorState +import net.moonleay.gimbal.editor.state.GimbalPolicyType +import net.moonleay.gimbal.editor.util.GimbalPolicy -object GimbleServer { +object GimbalServer { fun registerPacketHandler() { ServerPlayNetworking @@ -56,7 +56,7 @@ object GimbleServer { ServerEditorManager.updateEditorState(player.uuid, state) val buffer = PacketByteBufs.create() - buffer.writeByteArray(Cbor.encodeToByteArray(GimblePolicy(GimblePolicyType.ALLOWED))) + buffer.writeByteArray(Cbor.encodeToByteArray(GimbalPolicy(GimbalPolicyType.ALLOWED))) ServerPlayNetworking.send(player, PacketIDs.TRANSFER_GIMBLE_POLICY_ID, buffer) } } diff --git a/src/main/java/net/moonleay/gimble/networking/PacketIDs.kt b/src/main/java/net/moonleay/gimbal/networking/PacketIDs.kt similarity index 91% rename from src/main/java/net/moonleay/gimble/networking/PacketIDs.kt rename to src/main/java/net/moonleay/gimbal/networking/PacketIDs.kt index 2661f04..cae6037 100644 --- a/src/main/java/net/moonleay/gimble/networking/PacketIDs.kt +++ b/src/main/java/net/moonleay/gimbal/networking/PacketIDs.kt @@ -1,5 +1,5 @@ /* - * Gimble + * Gimbal * Copyright (C) 2024 moonleay * * This program is free software: you can redistribute it and/or modify @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -package net.moonleay.gimble.networking +package net.moonleay.gimbal.networking import net.minecraft.util.Identifier -import net.moonleay.gimble.build.BuildConstants +import net.moonleay.gimbal.build.BuildConstants object PacketIDs { val UPDATE_EDITOR_STATE_ID = Identifier(BuildConstants.modId, "update_editor_state") diff --git a/src/main/resources/assets/gimble/logo.png b/src/main/resources/assets/gimbal/logo.png similarity index 100% rename from src/main/resources/assets/gimble/logo.png rename to src/main/resources/assets/gimbal/logo.png diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 9817584..2a47121 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -11,8 +11,8 @@ "contact": { "email": "contact@moonleay.net", "homepage": "https://moonleay.net", - "sources": "https://codeberg.org/moonleay/Gimble", - "issues": "https://codeberg.org/moonleay/Gimble/issues" + "sources": "https://codeberg.org/moonleay/Gimbal", + "issues": "https://codeberg.org/moonleay/Gimbal/issues" }, "license": "GPL-3.0", "environment": "*", @@ -20,19 +20,19 @@ "client": [ { "adapter": "kotlin", - "value": "net.moonleay.gimble.client.ClientMain" + "value": "net.moonleay.gimbal.client.ClientMain" } ], "main": [ { "adapter": "kotlin", - "value": "net.moonleay.gimble.Main" + "value": "net.moonleay.gimbal.Main" } ], "fabric-datagen": [ { "adapter": "kotlin", - "value": "net.moonleay.gimble.datagen.DataGenerator" + "value": "net.moonleay.gimbal.datagen.DataGenerator" } ] }, diff --git a/src/main/resources/gimble.accesswidener b/src/main/resources/gimbal.accesswidener similarity index 100% rename from src/main/resources/gimble.accesswidener rename to src/main/resources/gimbal.accesswidener diff --git a/src/main/resources/gimble.mixins.json b/src/main/resources/gimbal.mixins.json similarity index 83% rename from src/main/resources/gimble.mixins.json rename to src/main/resources/gimbal.mixins.json index 9ec9090..2b67f6d 100644 --- a/src/main/resources/gimble.mixins.json +++ b/src/main/resources/gimbal.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "net.moonleay.gimble.mixin", + "package": "net.moonleay.gimbal.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ "ForcePlaceMixin", @@ -11,7 +11,7 @@ "client": [ "BulldozerMixin", "BulldozerMixin2", - "GimblePolicyCheckMixin", + "GimbalPolicyCheckMixin", "HudMixin", "NoClipCameraFixMixin", "NormalModeMixin", diff --git a/src/main/templates/net/moonleay/gimbal/build/BuildConstants.kt b/src/main/templates/net/moonleay/gimbal/build/BuildConstants.kt new file mode 100644 index 0000000..5b12b57 --- /dev/null +++ b/src/main/templates/net/moonleay/gimbal/build/BuildConstants.kt @@ -0,0 +1,25 @@ +/* + * Gimbal + * Copyright (C) 2024 moonleay + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package net.moonleay.gimbal.build + +internal object BuildConstants { + const val modId = "${modId}" + const val modName = "${modName}" + const val modVersion = "${modVersion}" +} diff --git a/src/main/templates/net/moonleay/gimble/build/BuildConstants.kt b/src/main/templates/net/moonleay/gimble/build/BuildConstants.kt deleted file mode 100644 index 85b65ee..0000000 --- a/src/main/templates/net/moonleay/gimble/build/BuildConstants.kt +++ /dev/null @@ -1,7 +0,0 @@ -package net.moonleay.gimble.build - -internal object BuildConstants { - const val modId = "${modId}" - const val modName = "${modName}" - const val modVersion = "${modVersion}" -}