chore: renamed to Gimbal, because I cannot spell apparently

Signed-off-by: moonleay <contact@moonleay.net>
moonleay 2024-04-29 15:08:02 +02:00
parent 1c7138bb58
commit c14cdffeed
Signed by: moonleay
GPG key ID: 82667543CCD715FB
50 changed files with 322 additions and 279 deletions

@ -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.

@ -1,4 +1,4 @@
# The Gimble project
# The Gimbal project
This project aims to improve the experience of creating structures in Minecraft.
## Features

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

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

@ -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 <https://www.gnu.org/licenses/>.
*/
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")
}
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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() {

@ -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 <https://www.gnu.org/licenses/>.
*/
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]")
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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<GimbleShortcut>()
private val shortcuts = mutableListOf<GimbalShortcut>()
/**
* Register a shortcut. This will also register the keybinding.
* */
fun registerShortcut(shortcut: GimbleShortcut) {
fun registerShortcut(shortcut: GimbalShortcut) {
shortcuts.add(shortcut)
KeyBindingRegistryImpl.registerKeyBinding(shortcut.keyBinding)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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))

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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)

@ -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 <https://www.gnu.org/licenses/>.
*/
package net.moonleay.gimble.client.util
package net.moonleay.gimbal.client.util
import net.minecraft.client.MinecraftClient
import net.minecraft.client.toast.SystemToast

@ -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 <https://www.gnu.org/licenses/>.
*/
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))
}
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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")
}
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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.*

@ -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 <https://www.gnu.org/licenses/>.
*/
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(

@ -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 <https://www.gnu.org/licenses/>.
*/
package net.moonleay.gimble.editor.state
package net.moonleay.gimbal.editor.state
enum class GimblePolicyType {
enum class GimbalPolicyType {
ALLOWED,
DENIED,
NOT_PRESENT

@ -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 <https://www.gnu.org/licenses/>.
*/
package net.moonleay.gimble.editor.state.mode
package net.moonleay.gimbal.editor.state.mode
enum class Capability {
INSERT,

@ -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 <https://www.gnu.org/licenses/>.
*/
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<ModeModifier>){
UNKNOWN("UNKNOWN", 0x000000, listOf()), // Unknown mode. This mode cannot be entered

@ -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 <https://www.gnu.org/licenses/>.
*/
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

@ -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 <https://www.gnu.org/licenses/>.
*/
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 {

@ -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 <https://www.gnu.org/licenses/>.
*/
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,
)

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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))

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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;

@ -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 <https://www.gnu.org/licenses/>.
*/
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<GimblePolicy>(buf.readByteArray())
val policy = Cbor.decodeFromByteArray<GimbalPolicy>(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))

@ -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 <https://www.gnu.org/licenses/>.
*/
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)
}
}

@ -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 <https://www.gnu.org/licenses/>.
*/
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")

Before

Width:  |  Height:  |  Size: 1,015 KiB

After

Width:  |  Height:  |  Size: 1,015 KiB

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

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

@ -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 <https://www.gnu.org/licenses/>.
*/
package net.moonleay.gimbal.build
internal object BuildConstants {
const val modId = "${modId}"
const val modName = "${modName}"
const val modVersion = "${modVersion}"
}

@ -1,7 +0,0 @@
package net.moonleay.gimble.build
internal object BuildConstants {
const val modId = "${modId}"
const val modName = "${modName}"
const val modVersion = "${modVersion}"
}