diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-21 00:24:33 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-04-21 00:24:53 +0200 |
commit | 43575ec3781bc617975f853df85294575875cfab (patch) | |
tree | d48742b9f8ffc883a79c26789763483293a94f0d /src/main/java/at/hannibal2/skyhanni/features | |
parent | 5ecf7f0e14f148f5c14952d98969f4033060bb88 (diff) | |
download | skyhanni-43575ec3781bc617975f853df85294575875cfab.tar.gz skyhanni-43575ec3781bc617975f853df85294575875cfab.tar.bz2 skyhanni-43575ec3781bc617975f853df85294575875cfab.zip |
Control + click in composter overlay opens bazaar search and copies required amount to clipboard.
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
4 files changed, 12 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt index a75060476..6682ffa81 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/BurrowWarpHelper.kt @@ -7,7 +7,6 @@ import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.sorted import at.hannibal2.skyhanni.utils.LorenzVec -import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent import org.lwjgl.input.Keyboard @@ -29,8 +28,7 @@ class BurrowWarpHelper { currentWarp?.let { if (System.currentTimeMillis() > lastWarpTime + 5_000) { lastWarpTime = System.currentTimeMillis() - val thePlayer = Minecraft.getMinecraft().thePlayer - thePlayer.sendChatMessage("/warp " + currentWarp?.name) + LorenzUtils.sendCommandToServer("warp " + currentWarp?.name) lastWarp = currentWarp } } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index adbe90245..dc88c14df 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -5,18 +5,15 @@ import at.hannibal2.skyhanni.data.model.ComposterUpgrade import at.hannibal2.skyhanni.events.* import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.composter.ComposterAPI.getLevel +import at.hannibal2.skyhanni.utils.* import at.hannibal2.skyhanni.utils.ItemUtils.name -import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.LorenzUtils.sortedDesc -import at.hannibal2.skyhanni.utils.NEUItems -import at.hannibal2.skyhanni.utils.NumberUtil import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.StringUtils.removeColor -import at.hannibal2.skyhanni.utils.TimeUtils import at.hannibal2.skyhanni.utils.jsonobjects.GardenJson import at.hannibal2.skyhanni.utils.renderables.Renderable import io.github.moulberry.notenoughupdates.NotEnoughUpdates @@ -368,9 +365,15 @@ class ComposterOverlay { val format = NumberUtil.format(totalPrice) val selected = if (internalName == currentOrganicMatterItem || internalName == currentFuelItem) "§n" else "" - val name = itemName.substring(0, 2) + selected + itemName.removeColor() + val rawItemName = itemName.removeColor() + val name = itemName.substring(0, 2) + selected + rawItemName list.add(Renderable.link("$name§r §8x${itemsNeeded.addSeparators()} §7(§6$format§7)") { onClick(internalName) + if (LorenzUtils.isControlKeyDown()) { + inInventory = false + LorenzUtils.sendCommandToServer("bz $rawItemName") + OSUtils.copyToClipboard("${itemsNeeded.toInt()}") + } }) bigList.add(list) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt index 2ef7e5378..88a4a713c 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenDeskInSBMenu.kt @@ -4,11 +4,11 @@ import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.events.InventoryCloseEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.features.garden.GardenAPI +import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NEUItems import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent import io.github.moulberry.notenoughupdates.events.SlotClickEvent import io.github.moulberry.notenoughupdates.util.Utils -import net.minecraft.client.Minecraft import net.minecraft.client.player.inventory.ContainerLocalMenu import net.minecraftforge.fml.common.eventhandler.EventPriority import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -45,8 +45,7 @@ class GardenDeskInSBMenu { fun onStackClick(event: SlotClickEvent) { if (showItem && event.slotId == 10) { event.isCanceled = true - val thePlayer = Minecraft.getMinecraft().thePlayer - thePlayer.sendChatMessage("/desk") + LorenzUtils.sendCommandToServer("desk") } } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index c339a5425..6fb6887c3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -142,8 +142,7 @@ class GardenVisitorFeatures { if (Minecraft.getMinecraft().currentScreen is GuiEditSign) { LorenzUtils.setTextIntoSign("$amount") } else if (!InventoryUtils.inStorage()) { - val thePlayer = Minecraft.getMinecraft().thePlayer - thePlayer.sendChatMessage("/bz ${name.removeColor()}"); + LorenzUtils.sendCommandToServer("bz ${name.removeColor()}") OSUtils.copyToClipboard("$amount") } }) { GardenAPI.inGarden() && !InventoryUtils.inStorage() }) |