feat: etherwarp overlay

This commit is contained in:
Jacob
2025-07-01 20:04:27 +08:00
committed by GitHub
parent acd7c95b7d
commit 383970ba99
5 changed files with 63 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ import moe.nea.firmament.features.inventory.SlotLocking
import moe.nea.firmament.features.inventory.WardrobeKeybinds
import moe.nea.firmament.features.inventory.buttons.InventoryButtons
import moe.nea.firmament.features.inventory.storageoverlay.StorageOverlay
import moe.nea.firmament.features.items.EtherwarpOverlay
import moe.nea.firmament.features.mining.PickaxeAbility
import moe.nea.firmament.features.mining.PristineProfitTracker
import moe.nea.firmament.features.misc.CustomCapes
@@ -72,6 +73,7 @@ object FeatureManager : DataHolder<FeatureManager.Config>(serializer(), "feature
loadFeature(Fixes)
loadFeature(CustomCapes)
loadFeature(Hud)
loadFeature(EtherwarpOverlay)
loadFeature(WardrobeKeybinds)
loadFeature(DianaWaypoints)
loadFeature(ItemRarityCosmetics)

View File

@@ -0,0 +1,49 @@
package moe.nea.firmament.features.items
import moe.nea.firmament.annotations.Subscribe
import moe.nea.firmament.features.FirmamentFeature
import moe.nea.firmament.gui.config.ManagedConfig
import moe.nea.firmament.util.MC
import net.minecraft.util.hit.BlockHitResult
import moe.nea.firmament.events.WorldRenderLastEvent
import moe.nea.firmament.util.extraAttributes
import moe.nea.firmament.util.render.RenderInWorldContext
import moe.nea.firmament.util.skyBlockId
import moe.nea.firmament.util.skyblock.SkyBlockItems
object EtherwarpOverlay : FirmamentFeature {
override val identifier: String
get() = "etherwarp-overlay"
object TConfig : ManagedConfig(identifier, Category.ITEMS) {
var etherwarpOverlay by toggle("etherwarp-overlay") { false }
var cube by toggle("cube") { true }
var wireframe by toggle("wireframe") { false }
}
override val config: ManagedConfig
get() = TConfig
@Subscribe
fun renderEtherwarpOverlay(event: WorldRenderLastEvent) {
if (!TConfig.etherwarpOverlay) return
val player = MC.player ?: return
val world = player.world
val camera = MC.camera ?: return
val heldItem = MC.stackInHand
if (heldItem.skyBlockId !in listOf(SkyBlockItems.ASPECT_OF_THE_VOID, SkyBlockItems.ASPECT_OF_THE_END)) return
if (!heldItem.extraAttributes.contains("ethermerge")) return
val hitResult = camera.raycast(61.0, 0.0f, false)
if (hitResult !is BlockHitResult) return
val blockPos = hitResult.blockPos
if (camera.squaredDistanceTo(blockPos.toCenterPos()) > 61 * 61) return
if (!world.getBlockState(blockPos.up()).isAir) return
if (!world.getBlockState(blockPos.up(2)).isAir) return
RenderInWorldContext.renderInWorld(event) {
if (TConfig.cube) block(blockPos, 0xFFFFFF00.toInt())
if (TConfig.wireframe) wireframeCube(blockPos, 10f)
}
}
}

View File

@@ -38,6 +38,7 @@ abstract class ManagedConfig(
MISC,
CHAT,
INVENTORY,
ITEMS,
MINING,
GARDEN,
EVENTS,

View File

@@ -14,4 +14,6 @@ object SkyBlockItems {
val SLICE_OF_GREEN_VELVET_CAKE = SkyblockId("SLICE_OF_GREEN_VELVET_CAKE")
val SLICE_OF_RED_VELVET_CAKE = SkyblockId("SLICE_OF_RED_VELVET_CAKE")
val SLICE_OF_STRAWBERRY_SHORTCAKE = SkyblockId("SLICE_OF_STRAWBERRY_SHORTCAKE")
val ASPECT_OF_THE_VOID = SkyblockId("ASPECT_OF_THE_VOID")
val ASPECT_OF_THE_END = SkyblockId("ASPECT_OF_THE_END")
}