From 7383fa09e835db0a46ac1a7969696f2ce77878ff Mon Sep 17 00:00:00 2001 From: moonleay Date: Tue, 23 Apr 2024 18:12:39 +0200 Subject: [PATCH] chore: moved group to net.moonleay fix: fixed camera going meyhem when going 3rd person in NoClip --- gradle.properties | 2 +- .../net/moonleay/{mods => }/gimble/Main.kt | 4 ++-- .../{mods => }/gimble/client/ClientMain.kt | 11 ++++----- .../gimble/client/editor/ClientEditor.kt | 18 +++++++------- .../gimble/client/editor/modes/Mode.kt | 2 +- .../client/editor/modes/ModeModifier.kt | 2 +- .../client/keybindings/KeybindingManager.kt | 5 ++-- .../client/keybindings/KeybindingRegistrar.kt | 24 +++++++++---------- .../client/keybindings/impl/GimbleShortcut.kt | 2 +- .../editormode/EnableInsertModeShortcut.kt | 8 +++---- .../editormode/EnableReplaceModeShortcut.kt | 8 +++---- .../editormode/EnableVisualModeShortcut.kt | 8 +++---- .../ToggleBulldozerModifierShortcut.kt | 8 +++---- .../ToggleForcePlaceModifierShortcut.kt | 8 +++---- .../ToggleNoClipModifierShortcut.kt | 8 +++---- .../ToggleNoUpdatesModifierShortcut.kt | 8 +++---- .../impl/gamemode/CreativeModeShortcut.kt | 6 ++--- .../impl/gamemode/SpectatorModeShortcut.kt | 6 ++--- .../impl/gamemode/SurvivalModeShortcut.kt | 6 ++--- .../{mods => }/gimble/client/util/ChatUtil.kt | 2 +- .../gimble/datagen/DataGenerator.kt | 4 ++-- .../datagen/En_us_GimbleLanguageProvider.kt | 2 +- .../{mods => }/gimble/mixin/HudMixin.java | 8 +++---- .../{mods => }/gimble/mixin/KeyMixin.java | 2 +- .../gimble/mixin/NoClipCameraFix.java | 21 ++++++++++++++++ .../{mods => }/gimble/mixin/NoClipMixin.java | 21 +++++++--------- .../gimble/mixin/NormalModeMixin.java | 6 ++--- .../gimble/mixin/ReplaceModeMixin.java | 9 ++++--- src/main/resources/fabric.mod.json | 6 ++--- src/main/resources/gimble.mixins.json | 3 ++- .../{mods => }/gimble/build/BuildConstants.kt | 4 ++-- 31 files changed, 125 insertions(+), 107 deletions(-) rename src/main/java/net/moonleay/{mods => }/gimble/Main.kt (76%) rename src/main/java/net/moonleay/{mods => }/gimble/client/ClientMain.kt (71%) rename src/main/java/net/moonleay/{mods => }/gimble/client/editor/ClientEditor.kt (82%) rename src/main/java/net/moonleay/{mods => }/gimble/client/editor/modes/Mode.kt (89%) rename src/main/java/net/moonleay/{mods => }/gimble/client/editor/modes/ModeModifier.kt (86%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/KeybindingManager.kt (81%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/KeybindingRegistrar.kt (78%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/GimbleShortcut.kt (78%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt (56%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt (56%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt (56%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt (55%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt (55%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt (54%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt (55%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt (60%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt (60%) rename src/main/java/net/moonleay/{mods => }/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt (60%) rename src/main/java/net/moonleay/{mods => }/gimble/client/util/ChatUtil.kt (93%) rename src/main/java/net/moonleay/{mods => }/gimble/datagen/DataGenerator.kt (85%) rename src/main/java/net/moonleay/{mods => }/gimble/datagen/En_us_GimbleLanguageProvider.kt (97%) rename src/main/java/net/moonleay/{mods => }/gimble/mixin/HudMixin.java (91%) rename src/main/java/net/moonleay/{mods => }/gimble/mixin/KeyMixin.java (93%) create mode 100644 src/main/java/net/moonleay/gimble/mixin/NoClipCameraFix.java rename src/main/java/net/moonleay/{mods => }/gimble/mixin/NoClipMixin.java (61%) rename src/main/java/net/moonleay/{mods => }/gimble/mixin/NormalModeMixin.java (91%) rename src/main/java/net/moonleay/{mods => }/gimble/mixin/ReplaceModeMixin.java (89%) rename src/main/templates/net/moonleay/{mods => }/gimble/build/BuildConstants.kt (78%) diff --git a/gradle.properties b/gradle.properties index a3908ce..4f714df 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ org.gradle.jvmargs=-Xmx2G modId=gimble kotlinx.serialization.version=1.6.2 fabric.kotlin.version=1.10.19+kotlin.1.9.23 -mavenGroup=net.moonleay.mods +mavenGroup=net.moonleay kotlin.code.style=official minecraft.version=1.19.2 modName=Gimble diff --git a/src/main/java/net/moonleay/mods/gimble/Main.kt b/src/main/java/net/moonleay/gimble/Main.kt similarity index 76% rename from src/main/java/net/moonleay/mods/gimble/Main.kt rename to src/main/java/net/moonleay/gimble/Main.kt index 4652724..43e211c 100644 --- a/src/main/java/net/moonleay/mods/gimble/Main.kt +++ b/src/main/java/net/moonleay/gimble/Main.kt @@ -1,6 +1,6 @@ -package net.moonleay.mods.gimble +package net.moonleay.gimble -import net.moonleay.mods.gimble.build.BuildConstants +import net.moonleay.gimble.build.BuildConstants import net.fabricmc.api.ModInitializer import org.apache.logging.log4j.LogManager diff --git a/src/main/java/net/moonleay/mods/gimble/client/ClientMain.kt b/src/main/java/net/moonleay/gimble/client/ClientMain.kt similarity index 71% rename from src/main/java/net/moonleay/mods/gimble/client/ClientMain.kt rename to src/main/java/net/moonleay/gimble/client/ClientMain.kt index 1507934..be650db 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/ClientMain.kt +++ b/src/main/java/net/moonleay/gimble/client/ClientMain.kt @@ -1,11 +1,10 @@ -package net.moonleay.mods.gimble.client +package net.moonleay.gimble.client -import net.moonleay.mods.gimble.build.BuildConstants +import net.moonleay.gimble.build.BuildConstants import net.fabricmc.api.ClientModInitializer import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.KeybindingManager -import net.moonleay.mods.gimble.client.keybindings.KeybindingRegistrar +import net.moonleay.gimble.client.keybindings.KeybindingManager +import net.moonleay.gimble.client.keybindings.KeybindingRegistrar import org.apache.logging.log4j.LogManager internal object ClientMain : ClientModInitializer { @@ -15,7 +14,7 @@ internal object ClientMain : ClientModInitializer { override fun onInitializeClient() { LOGGER.info("Initializing Gimble on the client side...") KeybindingRegistrar.registerKeybindings() - this.registerEvents() + registerEvents() LOGGER.info("Gimble has been initialized on the client side.") } diff --git a/src/main/java/net/moonleay/mods/gimble/client/editor/ClientEditor.kt b/src/main/java/net/moonleay/gimble/client/editor/ClientEditor.kt similarity index 82% rename from src/main/java/net/moonleay/mods/gimble/client/editor/ClientEditor.kt rename to src/main/java/net/moonleay/gimble/client/editor/ClientEditor.kt index 31f2ddb..fbe5422 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/editor/ClientEditor.kt +++ b/src/main/java/net/moonleay/gimble/client/editor/ClientEditor.kt @@ -1,9 +1,9 @@ -package net.moonleay.mods.gimble.client.editor +package net.moonleay.gimble.client.editor import net.minecraft.client.MinecraftClient -import net.moonleay.mods.gimble.client.util.ChatUtil -import net.moonleay.mods.gimble.client.editor.modes.Mode -import net.moonleay.mods.gimble.client.editor.modes.ModeModifier +import net.moonleay.gimble.client.util.ChatUtil +import net.moonleay.gimble.client.editor.modes.Mode +import net.moonleay.gimble.client.editor.modes.ModeModifier object ClientEditor { var CURRENT_MODE = Mode.NORMAL @@ -25,17 +25,19 @@ object ClientEditor { CURRENT_MODE_MODIFIER.add(mod) } - this.onModifiersUpdated() + onModifiersUpdated() } fun onModifiersUpdated() { CURRENT_MODE_MODIFIER.sort() - this.checkForIncompatibleModeModifiers() + checkForIncompatibleModeModifiers() } fun checkForIncompatibleModeModifiers() { if (TEMP_DISABLED_MODIFIERS.size > 0) { - CURRENT_MODE_MODIFIER.addAll(TEMP_DISABLED_MODIFIERS) + CURRENT_MODE_MODIFIER.addAll( + TEMP_DISABLED_MODIFIERS + ) TEMP_DISABLED_MODIFIERS.clear() } @@ -53,7 +55,7 @@ object ClientEditor { if(TEMP_DISABLED_MODIFIERS.isNotEmpty()) { ChatUtil.addToChatHistory("The following modifiers are not supported by this editor mode and are therefore currently disabled: " + - this.getListAsString(TEMP_DISABLED_MODIFIERS), MinecraftClient.getInstance()) + getListAsString(TEMP_DISABLED_MODIFIERS), MinecraftClient.getInstance()) } } diff --git a/src/main/java/net/moonleay/mods/gimble/client/editor/modes/Mode.kt b/src/main/java/net/moonleay/gimble/client/editor/modes/Mode.kt similarity index 89% rename from src/main/java/net/moonleay/mods/gimble/client/editor/modes/Mode.kt rename to src/main/java/net/moonleay/gimble/client/editor/modes/Mode.kt index b94a313..e0d1185 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/editor/modes/Mode.kt +++ b/src/main/java/net/moonleay/gimble/client/editor/modes/Mode.kt @@ -1,4 +1,4 @@ -package net.moonleay.mods.gimble.client.editor.modes +package net.moonleay.gimble.client.editor.modes enum class Mode(val displayName: String, val color: Int, val incompatibleModifiers: List){ NORMAL("NORMAL", 0x90a959, listOf(ModeModifier.NO_UPDATES, ModeModifier.BULLDOZER, ModeModifier.FORCE_PLACE)), // Do nothing diff --git a/src/main/java/net/moonleay/mods/gimble/client/editor/modes/ModeModifier.kt b/src/main/java/net/moonleay/gimble/client/editor/modes/ModeModifier.kt similarity index 86% rename from src/main/java/net/moonleay/mods/gimble/client/editor/modes/ModeModifier.kt rename to src/main/java/net/moonleay/gimble/client/editor/modes/ModeModifier.kt index 1ad5966..855b161 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/editor/modes/ModeModifier.kt +++ b/src/main/java/net/moonleay/gimble/client/editor/modes/ModeModifier.kt @@ -1,4 +1,4 @@ -package net.moonleay.mods.gimble.client.editor.modes +package net.moonleay.gimble.client.editor.modes enum class ModeModifier(val displayName: String) { // NONE("None"), // No Modifiers - default behavior diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/KeybindingManager.kt b/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingManager.kt similarity index 81% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/KeybindingManager.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/KeybindingManager.kt index ec3ca68..5257977 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/KeybindingManager.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingManager.kt @@ -1,9 +1,8 @@ -package net.moonleay.mods.gimble.client.keybindings +package net.moonleay.gimble.client.keybindings import net.fabricmc.fabric.impl.client.keybinding.KeyBindingRegistryImpl import net.minecraft.client.MinecraftClient -import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut object KeybindingManager { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/KeybindingRegistrar.kt b/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingRegistrar.kt similarity index 78% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/KeybindingRegistrar.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/KeybindingRegistrar.kt index 87eb7d7..0f38092 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/KeybindingRegistrar.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/KeybindingRegistrar.kt @@ -1,18 +1,18 @@ -package net.moonleay.mods.gimble.client.keybindings +package net.moonleay.gimble.client.keybindings import net.minecraft.client.option.KeyBinding import net.minecraft.client.util.InputUtil -import net.moonleay.mods.gimble.build.BuildConstants -import net.moonleay.mods.gimble.client.keybindings.impl.editormode.EnableInsertModeShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.editormode.EnableReplaceModeShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.editormode.EnableVisualModeShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier.ToggleBulldozerModifierShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier.ToggleForcePlaceModifierShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier.ToggleNoClipModifierShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier.ToggleNoUpdatesModifierShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.gamemode.CreativeModeShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.gamemode.SpectatorModeShortcut -import net.moonleay.mods.gimble.client.keybindings.impl.gamemode.SurvivalModeShortcut +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.editormode.EnableVisualModeShortcut +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 org.apache.logging.log4j.LogManager import org.lwjgl.glfw.GLFW diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/GimbleShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/GimbleShortcut.kt similarity index 78% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/GimbleShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/GimbleShortcut.kt index 6b97bd0..fdaa1a3 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/GimbleShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/GimbleShortcut.kt @@ -1,4 +1,4 @@ -package net.moonleay.mods.gimble.client.keybindings.impl +package net.moonleay.gimble.client.keybindings.impl import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt similarity index 56% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt index 06609cb..2b71b65 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableInsertModeShortcut.kt @@ -1,10 +1,10 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.editormode +package net.moonleay.gimble.client.keybindings.impl.editormode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.editor.modes.Mode +import net.moonleay.gimble.client.editor.ClientEditor +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.editor.modes.Mode class EnableInsertModeShortcut(key: KeyBinding): GimbleShortcut(key) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt similarity index 56% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt index 2f142ba..d735f05 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableReplaceModeShortcut.kt @@ -1,10 +1,10 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.editormode +package net.moonleay.gimble.client.keybindings.impl.editormode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.editor.modes.Mode +import net.moonleay.gimble.client.editor.ClientEditor +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.editor.modes.Mode class EnableReplaceModeShortcut(key: KeyBinding): GimbleShortcut(key) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt similarity index 56% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt index 92975be..d5aa13c 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormode/EnableVisualModeShortcut.kt @@ -1,10 +1,10 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.editormode +package net.moonleay.gimble.client.keybindings.impl.editormode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.editor.modes.Mode +import net.moonleay.gimble.client.editor.ClientEditor +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.editor.modes.Mode class EnableVisualModeShortcut(key: KeyBinding): GimbleShortcut(key) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt similarity index 55% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt index c8c75cf..b930b71 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleBulldozerModifierShortcut.kt @@ -1,10 +1,10 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimble.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.editor.modes.ModeModifier +import net.moonleay.gimble.client.editor.ClientEditor +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.editor.modes.ModeModifier class ToggleBulldozerModifierShortcut(key: KeyBinding): GimbleShortcut(key) { override fun onPressed(client: MinecraftClient) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt similarity index 55% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt index bfc5a1b..1bb4b8d 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleForcePlaceModifierShortcut.kt @@ -1,10 +1,10 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimble.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.editor.modes.ModeModifier +import net.moonleay.gimble.client.editor.ClientEditor +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.editor.modes.ModeModifier class ToggleForcePlaceModifierShortcut(key: KeyBinding): GimbleShortcut(key) { override fun onPressed(client: MinecraftClient) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt similarity index 54% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt index af84acf..c712ea6 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoClipModifierShortcut.kt @@ -1,10 +1,10 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimble.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.editor.modes.ModeModifier +import net.moonleay.gimble.client.editor.ClientEditor +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.editor.modes.ModeModifier class ToggleNoClipModifierShortcut(key: KeyBinding): GimbleShortcut(key) { override fun onPressed(client: MinecraftClient) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt similarity index 55% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt index d3571b7..0dc54f0 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/editormodemodifier/ToggleNoUpdatesModifierShortcut.kt @@ -1,10 +1,10 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.editormodemodifier +package net.moonleay.gimble.client.keybindings.impl.editormodemodifier import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.editor.ClientEditor -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.editor.modes.ModeModifier +import net.moonleay.gimble.client.editor.ClientEditor +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.editor.modes.ModeModifier class ToggleNoUpdatesModifierShortcut(key: KeyBinding): GimbleShortcut(key) { override fun onPressed(client: MinecraftClient) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt similarity index 60% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt index f09b081..57008a4 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/CreativeModeShortcut.kt @@ -1,9 +1,9 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.gamemode +package net.moonleay.gimble.client.keybindings.impl.gamemode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.util.ChatUtil +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.util.ChatUtil class CreativeModeShortcut(key: KeyBinding): GimbleShortcut(key) { override fun onPressed(client: MinecraftClient) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt similarity index 60% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt index 4006b16..346e783 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SpectatorModeShortcut.kt @@ -1,9 +1,9 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.gamemode +package net.moonleay.gimble.client.keybindings.impl.gamemode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.util.ChatUtil +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.util.ChatUtil class SpectatorModeShortcut(key: KeyBinding): GimbleShortcut(key) { override fun onPressed(client: MinecraftClient) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt b/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt similarity index 60% rename from src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt rename to src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt index 14eb41b..387ea8d 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt +++ b/src/main/java/net/moonleay/gimble/client/keybindings/impl/gamemode/SurvivalModeShortcut.kt @@ -1,9 +1,9 @@ -package net.moonleay.mods.gimble.client.keybindings.impl.gamemode +package net.moonleay.gimble.client.keybindings.impl.gamemode import net.minecraft.client.MinecraftClient import net.minecraft.client.option.KeyBinding -import net.moonleay.mods.gimble.client.keybindings.impl.GimbleShortcut -import net.moonleay.mods.gimble.client.util.ChatUtil +import net.moonleay.gimble.client.keybindings.impl.GimbleShortcut +import net.moonleay.gimble.client.util.ChatUtil class SurvivalModeShortcut(key: KeyBinding) : GimbleShortcut(key) { diff --git a/src/main/java/net/moonleay/mods/gimble/client/util/ChatUtil.kt b/src/main/java/net/moonleay/gimble/client/util/ChatUtil.kt similarity index 93% rename from src/main/java/net/moonleay/mods/gimble/client/util/ChatUtil.kt rename to src/main/java/net/moonleay/gimble/client/util/ChatUtil.kt index 5cbd58b..2d19bc0 100644 --- a/src/main/java/net/moonleay/mods/gimble/client/util/ChatUtil.kt +++ b/src/main/java/net/moonleay/gimble/client/util/ChatUtil.kt @@ -1,4 +1,4 @@ -package net.moonleay.mods.gimble.client.util +package net.moonleay.gimble.client.util import net.minecraft.client.MinecraftClient import net.minecraft.text.Text diff --git a/src/main/java/net/moonleay/mods/gimble/datagen/DataGenerator.kt b/src/main/java/net/moonleay/gimble/datagen/DataGenerator.kt similarity index 85% rename from src/main/java/net/moonleay/mods/gimble/datagen/DataGenerator.kt rename to src/main/java/net/moonleay/gimble/datagen/DataGenerator.kt index d432acd..a2267c8 100644 --- a/src/main/java/net/moonleay/mods/gimble/datagen/DataGenerator.kt +++ b/src/main/java/net/moonleay/gimble/datagen/DataGenerator.kt @@ -1,6 +1,6 @@ -package net.moonleay.mods.gimble.datagen +package net.moonleay.gimble.datagen -import net.moonleay.mods.gimble.build.BuildConstants +import net.moonleay.gimble.build.BuildConstants import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator import org.apache.logging.log4j.LogManager diff --git a/src/main/java/net/moonleay/mods/gimble/datagen/En_us_GimbleLanguageProvider.kt b/src/main/java/net/moonleay/gimble/datagen/En_us_GimbleLanguageProvider.kt similarity index 97% rename from src/main/java/net/moonleay/mods/gimble/datagen/En_us_GimbleLanguageProvider.kt rename to src/main/java/net/moonleay/gimble/datagen/En_us_GimbleLanguageProvider.kt index 8196c14..cca1464 100644 --- a/src/main/java/net/moonleay/mods/gimble/datagen/En_us_GimbleLanguageProvider.kt +++ b/src/main/java/net/moonleay/gimble/datagen/En_us_GimbleLanguageProvider.kt @@ -1,4 +1,4 @@ -package net.moonleay.mods.gimble.datagen +package net.moonleay.gimble.datagen import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider diff --git a/src/main/java/net/moonleay/mods/gimble/mixin/HudMixin.java b/src/main/java/net/moonleay/gimble/mixin/HudMixin.java similarity index 91% rename from src/main/java/net/moonleay/mods/gimble/mixin/HudMixin.java rename to src/main/java/net/moonleay/gimble/mixin/HudMixin.java index 56cb635..52c3dfc 100644 --- a/src/main/java/net/moonleay/mods/gimble/mixin/HudMixin.java +++ b/src/main/java/net/moonleay/gimble/mixin/HudMixin.java @@ -1,13 +1,13 @@ -package net.moonleay.mods.gimble.mixin; +package net.moonleay.gimble.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.minecraft.text.Text; -import net.moonleay.mods.gimble.client.editor.ClientEditor; -import net.moonleay.mods.gimble.client.editor.modes.Mode; -import net.moonleay.mods.gimble.client.editor.modes.ModeModifier; +import net.moonleay.gimble.client.editor.ClientEditor; +import net.moonleay.gimble.client.editor.modes.Mode; +import net.moonleay.gimble.client.editor.modes.ModeModifier; import org.jetbrains.annotations.NotNull; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/main/java/net/moonleay/mods/gimble/mixin/KeyMixin.java b/src/main/java/net/moonleay/gimble/mixin/KeyMixin.java similarity index 93% rename from src/main/java/net/moonleay/mods/gimble/mixin/KeyMixin.java rename to src/main/java/net/moonleay/gimble/mixin/KeyMixin.java index 8253ff8..865f208 100644 --- a/src/main/java/net/moonleay/mods/gimble/mixin/KeyMixin.java +++ b/src/main/java/net/moonleay/gimble/mixin/KeyMixin.java @@ -1,4 +1,4 @@ -package net.moonleay.mods.gimble.mixin; +package net.moonleay.gimble.mixin; import net.minecraft.client.Keyboard; import org.spongepowered.asm.mixin.Mixin; diff --git a/src/main/java/net/moonleay/gimble/mixin/NoClipCameraFix.java b/src/main/java/net/moonleay/gimble/mixin/NoClipCameraFix.java new file mode 100644 index 0000000..f164836 --- /dev/null +++ b/src/main/java/net/moonleay/gimble/mixin/NoClipCameraFix.java @@ -0,0 +1,21 @@ +package net.moonleay.gimble.mixin; + +import net.minecraft.client.render.Camera; +import net.moonleay.gimble.client.editor.ClientEditor; +import net.moonleay.gimble.client.editor.modes.ModeModifier; +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.CallbackInfoReturnable; + +@Mixin(Camera.class) +public class NoClipCameraFix { + + @Inject(method = "clipToSpace", at = @At("HEAD"), cancellable = true) + private void fixCameraInNoClip(double desiredCameraDistance, CallbackInfoReturnable cir) { + if (ClientEditor.INSTANCE.containsModifier(ModeModifier.NO_CLIP)){ + cir.setReturnValue(desiredCameraDistance); + cir.cancel(); + } + } +} diff --git a/src/main/java/net/moonleay/mods/gimble/mixin/NoClipMixin.java b/src/main/java/net/moonleay/gimble/mixin/NoClipMixin.java similarity index 61% rename from src/main/java/net/moonleay/mods/gimble/mixin/NoClipMixin.java rename to src/main/java/net/moonleay/gimble/mixin/NoClipMixin.java index 1d65009..dcb3ff1 100644 --- a/src/main/java/net/moonleay/mods/gimble/mixin/NoClipMixin.java +++ b/src/main/java/net/moonleay/gimble/mixin/NoClipMixin.java @@ -1,15 +1,9 @@ -package net.moonleay.mods.gimble.mixin; +package net.moonleay.gimble.mixin; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.network.Packet; -import net.minecraft.world.World; -import net.minecraft.world.entity.EntityLike; -import net.moonleay.mods.gimble.client.editor.ClientEditor; -import net.moonleay.mods.gimble.client.editor.modes.ModeModifier; +import net.moonleay.gimble.client.editor.ClientEditor; +import net.moonleay.gimble.client.editor.modes.ModeModifier; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -23,11 +17,14 @@ public class NoClipMixin { @Inject(method = "tick", at = @At(value = "HEAD")) private void enoClip(CallbackInfo ci) { - if (!ClientEditor.INSTANCE.containsModifier(ModeModifier.NO_CLIP)) + // TODO: Add player check, add multiplayer compat + if(!((Entity)(Object)this instanceof PlayerEntity)) // Only check on player return; - // TODO: Add player check, add multiplayer compat - if(!((Entity)(Object)this instanceof PlayerEntity)) + if (!ClientEditor.INSTANCE.containsModifier(ModeModifier.NO_CLIP)) + return; + PlayerEntity thePlayer = (PlayerEntity)(Object)this; + if (!thePlayer.getAbilities().flying) return; this.noClip = true; diff --git a/src/main/java/net/moonleay/mods/gimble/mixin/NormalModeMixin.java b/src/main/java/net/moonleay/gimble/mixin/NormalModeMixin.java similarity index 91% rename from src/main/java/net/moonleay/mods/gimble/mixin/NormalModeMixin.java rename to src/main/java/net/moonleay/gimble/mixin/NormalModeMixin.java index 1f4c572..9cdc340 100644 --- a/src/main/java/net/moonleay/mods/gimble/mixin/NormalModeMixin.java +++ b/src/main/java/net/moonleay/gimble/mixin/NormalModeMixin.java @@ -1,9 +1,9 @@ -package net.moonleay.mods.gimble.mixin; +package net.moonleay.gimble.mixin; import net.minecraft.client.MinecraftClient; import net.minecraft.client.option.GameOptions; -import net.moonleay.mods.gimble.client.editor.ClientEditor; -import net.moonleay.mods.gimble.client.editor.modes.Mode; +import net.moonleay.gimble.client.editor.modes.Mode; +import net.moonleay.gimble.client.editor.ClientEditor; 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/mods/gimble/mixin/ReplaceModeMixin.java b/src/main/java/net/moonleay/gimble/mixin/ReplaceModeMixin.java similarity index 89% rename from src/main/java/net/moonleay/mods/gimble/mixin/ReplaceModeMixin.java rename to src/main/java/net/moonleay/gimble/mixin/ReplaceModeMixin.java index 846f8e2..7e4d671 100644 --- a/src/main/java/net/moonleay/mods/gimble/mixin/ReplaceModeMixin.java +++ b/src/main/java/net/moonleay/gimble/mixin/ReplaceModeMixin.java @@ -1,4 +1,4 @@ -package net.moonleay.mods.gimble.mixin; +package net.moonleay.gimble.mixin; import net.minecraft.block.BlockState; import net.minecraft.client.MinecraftClient; @@ -11,8 +11,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.mods.gimble.client.editor.ClientEditor; -import net.moonleay.mods.gimble.client.editor.modes.Mode; +import net.moonleay.gimble.client.editor.ClientEditor; +import net.moonleay.gimble.client.editor.modes.Mode; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -44,9 +44,8 @@ public abstract class ReplaceModeMixin { assert this.interactionManager != null; if (!this.interactionManager.getCurrentGameMode().isCreative()) return; - if (!(this.crosshairTarget instanceof BlockHitResult)) + if (!(this.crosshairTarget instanceof BlockHitResult blockHitResult)) return; - BlockHitResult blockHitResult = (BlockHitResult)this.crosshairTarget; if (blockHitResult == null) return; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1ae3592..c5cddc2 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -14,19 +14,19 @@ "client": [ { "adapter": "kotlin", - "value": "net.moonleay.mods.gimble.client.ClientMain" + "value": "net.moonleay.gimble.client.ClientMain" } ], "main": [ { "adapter": "kotlin", - "value": "net.moonleay.mods.gimble.Main" + "value": "net.moonleay.gimble.Main" } ], "fabric-datagen": [ { "adapter": "kotlin", - "value": "net.moonleay.mods.gimble.datagen.DataGenerator" + "value": "net.moonleay.gimble.datagen.DataGenerator" } ] }, diff --git a/src/main/resources/gimble.mixins.json b/src/main/resources/gimble.mixins.json index 48557e1..1a39739 100644 --- a/src/main/resources/gimble.mixins.json +++ b/src/main/resources/gimble.mixins.json @@ -1,13 +1,14 @@ { "required": true, "minVersion": "0.8", - "package": "net.moonleay.mods.gimble.mixin", + "package": "net.moonleay.gimble.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ "NoClipMixin" ], "client": [ "HudMixin", + "NoClipCameraFix", "NormalModeMixin", "ReplaceModeMixin" ], diff --git a/src/main/templates/net/moonleay/mods/gimble/build/BuildConstants.kt b/src/main/templates/net/moonleay/gimble/build/BuildConstants.kt similarity index 78% rename from src/main/templates/net/moonleay/mods/gimble/build/BuildConstants.kt rename to src/main/templates/net/moonleay/gimble/build/BuildConstants.kt index 9111230..85b65ee 100644 --- a/src/main/templates/net/moonleay/mods/gimble/build/BuildConstants.kt +++ b/src/main/templates/net/moonleay/gimble/build/BuildConstants.kt @@ -1,7 +1,7 @@ -package net.moonleay.mods.gimble.build +package net.moonleay.gimble.build internal object BuildConstants { const val modId = "${modId}" const val modName = "${modName}" const val modVersion = "${modVersion}" -} \ No newline at end of file +}