diff options
author | Jacob <55346310+Kathund@users.noreply.github.com> | 2025-07-01 20:04:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-01 14:04:27 +0200 |
commit | 383970ba997e8b51a6e117e4df362bfb2cb972a1 (patch) | |
tree | f2d4087e7f03b642608e2ecf0c882e3c092ab47e /src | |
parent | acd7c95b7d1bf62cc4cda09487ea8ec3b6e7266f (diff) | |
download | Firmament-383970ba997e8b51a6e117e4df362bfb2cb972a1.tar.gz Firmament-383970ba997e8b51a6e117e4df362bfb2cb972a1.tar.bz2 Firmament-383970ba997e8b51a6e117e4df362bfb2cb972a1.zip |
feat: etherwarp overlay
Diffstat (limited to 'src')
-rw-r--r-- | src/main/kotlin/features/FeatureManager.kt | 2 | ||||
-rw-r--r-- | src/main/kotlin/features/items/EtherwarpOverlay.kt | 49 | ||||
-rw-r--r-- | src/main/kotlin/gui/config/ManagedConfig.kt | 1 | ||||
-rw-r--r-- | src/main/kotlin/util/skyblock/SkyBlockItems.kt | 2 |
4 files changed, 54 insertions, 0 deletions
diff --git a/src/main/kotlin/features/FeatureManager.kt b/src/main/kotlin/features/FeatureManager.kt index 447edb8..e0799c4 100644 --- a/src/main/kotlin/features/FeatureManager.kt +++ b/src/main/kotlin/features/FeatureManager.kt @@ -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) diff --git a/src/main/kotlin/features/items/EtherwarpOverlay.kt b/src/main/kotlin/features/items/EtherwarpOverlay.kt new file mode 100644 index 0000000..83e533c --- /dev/null +++ b/src/main/kotlin/features/items/EtherwarpOverlay.kt @@ -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) + } + } +} diff --git a/src/main/kotlin/gui/config/ManagedConfig.kt b/src/main/kotlin/gui/config/ManagedConfig.kt index 125eaab..ba6792d 100644 --- a/src/main/kotlin/gui/config/ManagedConfig.kt +++ b/src/main/kotlin/gui/config/ManagedConfig.kt @@ -38,6 +38,7 @@ abstract class ManagedConfig( MISC, CHAT, INVENTORY, + ITEMS, MINING, GARDEN, EVENTS, diff --git a/src/main/kotlin/util/skyblock/SkyBlockItems.kt b/src/main/kotlin/util/skyblock/SkyBlockItems.kt index 74e1327..9854be0 100644 --- a/src/main/kotlin/util/skyblock/SkyBlockItems.kt +++ b/src/main/kotlin/util/skyblock/SkyBlockItems.kt @@ -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") } |