Add slot binding

This commit is contained in:
Linnea Gräf
2024-10-18 00:41:25 +02:00
parent 7de0e8e7e0
commit c89b663aca
9 changed files with 609 additions and 307 deletions

View File

@@ -29,6 +29,7 @@ import moe.nea.firmament.util.TimeMark
import moe.nea.firmament.util.customgui.CustomGui
import moe.nea.firmament.util.customgui.customGui
import moe.nea.firmament.util.mc.CommonTextures
import moe.nea.firmament.util.mc.SlotUtils.clickRightMouseButton
import moe.nea.firmament.util.mc.displayNameAccordingToNbt
import moe.nea.firmament.util.unformattedString
import moe.nea.firmament.util.useMatch
@@ -103,26 +104,6 @@ object HotmPresets {
var hasScrolled = false
var hasAll = false
fun Slot.clickMiddleMouseButton(handler: ScreenHandler) {
MC.interactionManager?.clickSlot(
handler.syncId,
this.id,
2,
SlotActionType.CLONE,
MC.player
)
}
fun Slot.clickRightMouseButton(handler: ScreenHandler) {
MC.interactionManager?.clickSlot(
handler.syncId,
this.id,
1,
SlotActionType.PICKUP,
MC.player
)
}
override fun mouseClick(mouseX: Double, mouseY: Double, button: Int): Boolean {
if (!hasScrolled) {
val slot = screen.screenHandler.getSlot(8)