Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ dependencies {

// If you don't want to log in with your real minecraft account, remove this line
runtimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.2.1")
shadowImpl("org.joml:joml:1.10.8")
shadowImpl("org.lwjgl:lwjgl-stb:3.2.2")
shadowImpl("org.lwjgl:lwjgl-stb:3.2.2:natives-windows")
}

// Tasks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
package com.github.freedownloadhere.killauravideo

import com.github.freedownloadhere.killauravideo.rendering.RenderUtils
import com.github.freedownloadhere.killauravideo.ui.core.Core
import com.github.freedownloadhere.killauravideo.ui.core.UICore
import com.github.freedownloadhere.killauravideo.ui.core.render.RenderingBackend
import com.github.freedownloadhere.killauravideo.utils.EntityPositions
import com.github.freedownloadhere.killauravideo.utils.KeybindMap
import net.minecraft.client.Minecraft
import net.minecraft.client.entity.EntityPlayerSP
import net.minecraft.client.multiplayer.WorldClient
import net.minecraftforge.client.event.DrawBlockHighlightEvent
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
import net.minecraftforge.fml.common.gameevent.TickEvent

object GlobalManager {
var clientInstance: ClientInstance? = null
private set
var core: Core? = null
var core: UICore? = null

private var lastPlayer: EntityPlayerSP? = null
private var lastWorld: WorldClient? = null
Expand Down Expand Up @@ -59,4 +61,18 @@ object GlobalManager {
clientInstance = ClientInstance(player, world, Minecraft.getMinecraft().gameSettings)
clientInstance!!.init()
}

private var tempInit = false
@SubscribeEvent
fun renderWorldEvent(e: RenderWorldLastEvent) {
if(tempInit) return
val sw = Minecraft.getMinecraft().displayWidth.toFloat()
val sh = Minecraft.getMinecraft().displayHeight.toFloat()
RenderingBackend.init(sw, sh)
RenderingBackend.loadTexture(
"checkmark",
"/assets/killauravideo/textures/gui/check.png"
)
tempInit = true
}
}
10 changes: 8 additions & 2 deletions src/main/java/com/github/freedownloadhere/killauravideo/Mod.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.github.freedownloadhere.killauravideo

import com.github.freedownloadhere.killauravideo.commands.CommandToggle
import com.github.freedownloadhere.killauravideo.ui.core.Core
import com.github.freedownloadhere.killauravideo.ui.core.UICore
import com.github.freedownloadhere.killauravideo.ui.dsl.text
import com.github.freedownloadhere.killauravideo.utils.KeybindMap
import com.github.freedownloadhere.killauravideo.utils.LibraryLoading
import net.minecraft.client.Minecraft
import net.minecraft.client.settings.KeyBinding
import net.minecraftforge.client.ClientCommandHandler
Expand All @@ -15,11 +17,15 @@ import org.lwjgl.input.Keyboard
class Mod {
@Mod.EventHandler
fun init(e: FMLInitializationEvent) {
LibraryLoading.load()

MinecraftForge.EVENT_BUS.register(GlobalManager)
ClientCommandHandler.instance.registerCommand(CommandToggle())

KeybindMap.addKey(KeyBinding("Toggle UI", Keyboard.KEY_J, "")) {
GlobalManager.core = Core()
GlobalManager.core = UICore {
text("hello")
}
Minecraft.getMinecraft().displayGuiScreen(GlobalManager.core!!)
}
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading