Update to 1.20.4, and just generally fixing up code. This version actually runs!
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package chickenmanfy.scify
|
||||
|
||||
import io.github.prospector.modmenu.api.ConfigScreenFactory
|
||||
import io.github.prospector.modmenu.api.ModMenuApi
|
||||
import net.fabricmc.api.ClientModInitializer
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents
|
||||
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper
|
||||
@@ -10,64 +8,25 @@ import net.minecraft.client.option.KeyBinding
|
||||
import net.minecraft.client.util.InputUtil
|
||||
import net.minecraft.text.Text
|
||||
import org.lwjgl.glfw.GLFW
|
||||
import net.fabricmc.api.EnvType
|
||||
import net.fabricmc.api.Environment
|
||||
import net.minecraft.client.gui.screen.Screen
|
||||
import net.minecraft.client.gui.widget.ButtonWidget
|
||||
import net.minecraft.client.util.math.MatrixStack
|
||||
|
||||
|
||||
object SciFyClient : ClientModInitializer {
|
||||
override fun onInitializeClient() {
|
||||
|
||||
val menu = KeyBindingHelper.registerKeyBinding(
|
||||
KeyBinding(
|
||||
"Menu",
|
||||
InputUtil.Type.KEYSYM,
|
||||
GLFW.GLFW_KEY_RIGHT_SHIFT,
|
||||
"SciFy"
|
||||
)
|
||||
)
|
||||
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { client: MinecraftClient ->
|
||||
while (menu.wasPressed()) {
|
||||
// Debug
|
||||
client.player!!.sendMessage(Text.literal("Button input received."), true)
|
||||
override fun onInitializeClient() {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
val menu = KeyBindingHelper.registerKeyBinding(
|
||||
KeyBinding(
|
||||
"Menu",
|
||||
InputUtil.Type.KEYSYM,
|
||||
GLFW.GLFW_KEY_RIGHT_SHIFT,
|
||||
"SciFy"
|
||||
)
|
||||
)
|
||||
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { client: MinecraftClient ->
|
||||
while (menu.wasPressed()) {
|
||||
// Debug
|
||||
client.player!!.sendMessage(Text.literal("Button input received."), true)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
class ScifyModMenu : ModMenuApi {
|
||||
override fun getModConfigScreenFactory(): ConfigScreenFactory<*> {
|
||||
return ConfigScreenFactory<*> { parent -> menu(parent) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
class menu(private val parent: Screen) : Screen(Text.literal("Your Mod Config")) {
|
||||
override fun init() {
|
||||
// Add a button to open Mod Menu
|
||||
val modMenuButton = ButtonWidget.builder(
|
||||
Text.literal("Mod Menu")
|
||||
) { button: ButtonWidget? ->
|
||||
// Open Mod Menu
|
||||
ModMenu.getInstance().openConfigScreen()
|
||||
}
|
||||
.dimensions(width / 2 - 100, height / 2, 200, 20)
|
||||
.build()
|
||||
|
||||
addDrawableChild(modMenuButton)
|
||||
}
|
||||
|
||||
override fun render(matrices: MatrixStack, mouseX: Int, mouseY: Int, delta: Float) {
|
||||
renderBackground(matrices)
|
||||
super.render(matrices, mouseX, mouseY, delta)
|
||||
}
|
||||
|
||||
fun onClose() {
|
||||
client!!.setScreen(parent)
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,6 @@ package chickenmanfy.scify
|
||||
import net.fabricmc.api.ModInitializer
|
||||
|
||||
object SciFy : ModInitializer {
|
||||
override fun onInitialize() {
|
||||
}
|
||||
override fun onInitialize() {
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,22 @@
|
||||
"id": "scify",
|
||||
"version": "${version}",
|
||||
"name": "SciFy",
|
||||
"description": "A Dungeonfy mod so good you'll think it's science fiction",
|
||||
"description": "A Dungeonfy mod so good you'll think it's science fiction\n\n\nThanks to the Dungeonfy community for giving me something to do during summer -Chickenmanfy",
|
||||
"authors": [
|
||||
"Main Developer: Chickenmanfy",
|
||||
"Server Owner: Enook",
|
||||
"Thanks to Endr. for help with some bugs!"
|
||||
{
|
||||
"name": "Chickenmanfy",
|
||||
"role": "Main Developer"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Endr.",
|
||||
"role": "Help with bugs"
|
||||
}
|
||||
],
|
||||
"contact": {
|
||||
"homepage": "https://modrinth.com",
|
||||
"sources": "https://github.com/chickenmanfy/scify/",
|
||||
"homepage": "https://modrinth.com/project/scify",
|
||||
"sources": "https://github.com/chickenmanfy/scify",
|
||||
"issues": "https://github.com/chickenmanfy/scify/issues"
|
||||
},
|
||||
"license": "MPL-2.0",
|
||||
@@ -40,7 +47,7 @@
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"minecraft": "~1.19.4",
|
||||
"minecraft": "~1.20.4",
|
||||
"java": ">=17",
|
||||
"fabric-api": "*",
|
||||
"fabric-language-kotlin": ">=1.9.22"
|
||||
|
||||
Reference in New Issue
Block a user