From 649aac85c3feef069b9e8f0f81ea9c9b321ccdb0 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Thu, 10 Jul 2025 19:54:49 +0200 Subject: feat: Option to choose the colour of the highlight search result --- .../features/inventory/storageoverlay/StorageOverlay.kt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/features') diff --git a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt index 988a7c8..f59b293 100644 --- a/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt +++ b/src/main/kotlin/features/inventory/storageoverlay/StorageOverlay.kt @@ -48,6 +48,15 @@ object StorageOverlay : FirmamentFeature { val margin by integer("margin", 1, 60) { 20 } val itemsBlockScrolling by toggle("block-item-scrolling") { true } val highlightSearchResults by toggle("highlight-search-results") { true } + val highlightSearchResultsColour by colour("highlight-search-results-colour") { + ChromaColour.fromRGB( + 0, + 176, + 0, + 0, + 255 + ) + } } @Subscribe @@ -60,7 +69,13 @@ object StorageOverlay : FirmamentFeature { val stack = event.slot.stack ?: return val search = storageOverlayScreen.searchText.get().takeIf { it.isNotBlank() } ?: return if (storageOverlayScreen.matchesSearch(stack, search)) { - event.context.fill(event.slot.x, event.slot.y, event.slot.x + 16, event.slot.y + 16, 0xFF00B000.toInt()) + event.context.fill( + event.slot.x, + event.slot.y, + event.slot.x + 16, + event.slot.y + 16, + TConfig.highlightSearchResultsColour.getEffectiveColourRGB() + ) } } -- cgit From 4cd6602805c052ad96b4a39a72b187478d3e501a Mon Sep 17 00:00:00 2001 From: Jacob Date: Mon, 14 Jul 2025 19:28:22 +0800 Subject: fix: Item/NPC Exporter allows non alphabet or number chars in ID --- src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/kotlin/features') diff --git a/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt b/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt index 4f9acd8..9356dd3 100644 --- a/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt +++ b/src/main/kotlin/features/debug/itemeditor/ExportRecipe.kt @@ -185,7 +185,7 @@ object ExportRecipe { } fun generateName(name: String): SkyblockId { - return SkyblockId(name.uppercase().replace(" ", "_").replace("(", "").replace(")", "")) + return SkyblockId(name.uppercase().replace(" ", "_").replace(Regex("[^A-Z_]+"), "")) } fun findStackableItemByName(name: String, fallbackToGenerated: Boolean = false): Pair? { -- cgit From 773a8bec96877d0210044b335a83ac12a460cad5 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Fri, 25 Jul 2025 01:34:22 +0200 Subject: feat: Option to disable cross-hair cooldown in Dungeons --- src/main/kotlin/features/mining/PickaxeAbility.kt | 4 +++- translations/en_us.json | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin/features') diff --git a/src/main/kotlin/features/mining/PickaxeAbility.kt b/src/main/kotlin/features/mining/PickaxeAbility.kt index 430bae0..a049001 100644 --- a/src/main/kotlin/features/mining/PickaxeAbility.kt +++ b/src/main/kotlin/features/mining/PickaxeAbility.kt @@ -7,7 +7,6 @@ import kotlin.time.Duration.Companion.seconds import net.minecraft.client.MinecraftClient import net.minecraft.client.toast.SystemToast import net.minecraft.item.ItemStack -import net.minecraft.text.Text import net.minecraft.util.DyeColor import net.minecraft.util.Hand import net.minecraft.util.Identifier @@ -37,6 +36,7 @@ import moe.nea.firmament.util.red import moe.nea.firmament.util.render.RenderCircleProgress import moe.nea.firmament.util.render.lerp import moe.nea.firmament.util.skyblock.AbilityUtils +import moe.nea.firmament.util.skyblock.DungeonUtil import moe.nea.firmament.util.skyblock.ItemType import moe.nea.firmament.util.toShedaniel import moe.nea.firmament.util.tr @@ -50,6 +50,7 @@ object PickaxeAbility : FirmamentFeature { object TConfig : ManagedConfig(identifier, Category.MINING) { val cooldownEnabled by toggle("ability-cooldown") { false } + val disableInDungeons by toggle("disable-in-dungeons") { true } val cooldownScale by integer("ability-scale", 16, 64) { 16 } val cooldownReadyToast by toggle("ability-cooldown-toast") { false } val drillFuelBar by toggle("fuel-bar") { true } @@ -222,6 +223,7 @@ object PickaxeAbility : FirmamentFeature { @Subscribe fun renderHud(event: HudRenderEvent) { if (!TConfig.cooldownEnabled) return + if (TConfig.disableInDungeons && DungeonUtil.isInDungeonIsland) return if (!event.isRenderingCursor) return var ability = getCooldownFromLore(MC.player?.getStackInHand(Hand.MAIN_HAND) ?: return) ?: return defaultAbilityDurations[ability.name] = ability.cooldown diff --git a/translations/en_us.json b/translations/en_us.json index 7e015a2..12fc57d 100644 --- a/translations/en_us.json +++ b/translations/en_us.json @@ -244,6 +244,8 @@ "firmament.config.pickaxe-info.block-on-dynamic.choice.never": "Never Block", "firmament.config.pickaxe-info.block-on-dynamic.choice.only_destructive": "Only with dangerous", "firmament.config.pickaxe-info.block-on-dynamic.description": "Block pickaxe abilities on private islands by preventing you from right clicking.", + "firmament.config.pickaxe-info.disable-in-dungeons": "Disable cross-hair cooldown in Dungeons", + "firmament.config.pickaxe-info.disable-in-dungeons.description": "Disables the cooldown around your cross-hair while in Dungeons.", "firmament.config.pickaxe-info.fuel-bar": "Drill Fuel Durability Bar", "firmament.config.pickaxe-info.fuel-bar.description": "Replace the item durability bar of your drills with one that shows the remaining fuel.", "firmament.config.power-user": "Power Users", -- cgit From 3fe5ec7233fcfaa6884c7676fd720f3a3600cd58 Mon Sep 17 00:00:00 2001 From: Jacob <55346310+Kathund@users.noreply.github.com> Date: Tue, 12 Aug 2025 04:58:14 +0800 Subject: feat: remove offhand (#125) --- .../firmament/mixins/MixinPlayerScreenHandler.java | 31 ++++++++++++++++++++++ src/main/kotlin/features/fixes/Fixes.kt | 1 + translations/en_us.json | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 src/main/java/moe/nea/firmament/mixins/MixinPlayerScreenHandler.java (limited to 'src/main/kotlin/features') diff --git a/src/main/java/moe/nea/firmament/mixins/MixinPlayerScreenHandler.java b/src/main/java/moe/nea/firmament/mixins/MixinPlayerScreenHandler.java new file mode 100644 index 0000000..12455f4 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/MixinPlayerScreenHandler.java @@ -0,0 +1,31 @@ +package moe.nea.firmament.mixins; + +import moe.nea.firmament.features.fixes.Fixes; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.screen.PlayerScreenHandler; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(PlayerScreenHandler.class) +public class MixinPlayerScreenHandler { + + @Unique + private static final int OFF_HAND_SLOT = 40; + + @Inject(method = "", at = @At("TAIL")) + private void moveOffHandSlot(PlayerInventory inventory, boolean onServer, PlayerEntity owner, CallbackInfo ci) { + if (Fixes.TConfig.INSTANCE.getHideOffHand()) { + PlayerScreenHandler self = (PlayerScreenHandler) (Object) this; + self.slots.stream() + .filter(slot -> slot.getIndex() == OFF_HAND_SLOT) + .forEach(slot -> { + slot.x = -1000; + slot.y = -1000; + }); + } + } +} diff --git a/src/main/kotlin/features/fixes/Fixes.kt b/src/main/kotlin/features/fixes/Fixes.kt index d490cc4..0105624 100644 --- a/src/main/kotlin/features/fixes/Fixes.kt +++ b/src/main/kotlin/features/fixes/Fixes.kt @@ -29,6 +29,7 @@ object Fixes : FirmamentFeature { val noHurtCam by toggle("disable-hurt-cam") { false } val hideSlotHighlights by toggle("hide-slot-highlights") { false } val hideRecipeBook by toggle("hide-recipe-book") { false } + val hideOffHand by toggle("hide-off-hand") { false } } override val config: ManagedConfig diff --git a/translations/en_us.json b/translations/en_us.json index 12fc57d..542abe0 100644 --- a/translations/en_us.json +++ b/translations/en_us.json @@ -160,6 +160,8 @@ "firmament.config.fixes.disable-hurt-cam.description": "Disable the damage screen shake animation.", "firmament.config.fixes.hide-mob-effects": "Hide Potion Effects", "firmament.config.fixes.hide-mob-effects.description": "Hide Potion effects on the right side of your player inventory.", + "firmament.config.fixes.hide-off-hand": "No Off Hand", + "firmament.config.fixes.hide-off-hand.description": "Remove the recipe slot from your inventory", "firmament.config.fixes.hide-potion-effects-hud": "Hide Potion Effects HUD", "firmament.config.fixes.hide-potion-effects-hud.description": "Hides the potion effects HUD in the top right.", "firmament.config.fixes.hide-recipe-book": "No Recipe Book", -- cgit From 6bd39eb81fb35b4dbd3107955a076ccacc70ee23 Mon Sep 17 00:00:00 2001 From: Raghav <71544502+Raghav314@users.noreply.github.com> Date: Wed, 6 Aug 2025 18:48:51 +0530 Subject: fix: bazaar buy/sell order tooltip text swapped --- src/main/kotlin/features/inventory/PriceData.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/kotlin/features') diff --git a/src/main/kotlin/features/inventory/PriceData.kt b/src/main/kotlin/features/inventory/PriceData.kt index 92bfc58..241fb43 100644 --- a/src/main/kotlin/features/inventory/PriceData.kt +++ b/src/main/kotlin/features/inventory/PriceData.kt @@ -88,13 +88,13 @@ object PriceData : FirmamentFeature { it.lines.add(multiplierText) it.lines.add( formatPrice( - tr("firmament.tooltip.bazaar.sell-order", "Bazaar Sell Order"), + tr("firmament.tooltip.bazaar.buy-order", "Bazaar Buy Order"), bazaarData.quickStatus.sellPrice * multiplier ) ) it.lines.add( formatPrice( - tr("firmament.tooltip.bazaar.buy-order", "Bazaar Buy Order"), + tr("firmament.tooltip.bazaar.sell-order", "Bazaar Sell Order"), bazaarData.quickStatus.buyPrice * multiplier ) ) -- cgit From f3e5a5181b47b0a7c51dd04722e0cc912a52b4dc Mon Sep 17 00:00:00 2001 From: Wapic <17051068+Wapic@users.noreply.github.com> Date: Mon, 14 Jul 2025 21:48:07 +0200 Subject: feat: Junk Highlighter --- .../kotlin/features/inventory/JunkHighlighter.kt | 29 ++++++++++++++++++++++ translations/en_us.json | 6 +++++ 2 files changed, 35 insertions(+) create mode 100644 src/main/kotlin/features/inventory/JunkHighlighter.kt (limited to 'src/main/kotlin/features') diff --git a/src/main/kotlin/features/inventory/JunkHighlighter.kt b/src/main/kotlin/features/inventory/JunkHighlighter.kt new file mode 100644 index 0000000..80fd99d --- /dev/null +++ b/src/main/kotlin/features/inventory/JunkHighlighter.kt @@ -0,0 +1,29 @@ +package moe.nea.firmament.features.inventory + +import org.lwjgl.glfw.GLFW +import moe.nea.firmament.annotations.Subscribe +import moe.nea.firmament.events.SlotRenderEvents +import moe.nea.firmament.features.FirmamentFeature +import moe.nea.firmament.gui.config.ManagedConfig +import moe.nea.firmament.util.skyblock.SBItemUtil.getSearchName +import moe.nea.firmament.util.useMatch + +object JunkHighlighter : FirmamentFeature { + override val identifier: String + get() = "junk-highlighter" + + object TConfig : ManagedConfig(identifier, Category.INVENTORY) { + val junkRegex by string("regex") { "" } + val highlightBind by keyBinding("highlight") { GLFW.GLFW_KEY_LEFT_CONTROL } + } + + @Subscribe + fun onDrawSlot(event: SlotRenderEvents.After) { + if(!TConfig.highlightBind.isPressed() || TConfig.junkRegex.isEmpty()) return + val junkRegex = TConfig.junkRegex.toPattern() + val slot = event.slot + junkRegex.useMatch(slot.stack.getSearchName()) { + event.context.fill(slot.x, slot.y, slot.x + 16, slot.y + 16, 0xffff0000.toInt()) + } + } +} diff --git a/translations/en_us.json b/translations/en_us.json index 542abe0..5404862 100644 --- a/translations/en_us.json +++ b/translations/en_us.json @@ -423,6 +423,12 @@ "firmament.config.waypoints.skip-to-nearest.description": "Allow skipping waypoints in an ordered list. If disabled you will need to walk to the next point, before being allowed to the next one after.", "firmament.config.waypoints.temp-waypoint-duration": "Temporary Waypoint Duration", "firmament.config.waypoints.temp-waypoint-duration.description": "Display waypoints sent by other players using /firm sendcoords in the world.", + "firmament.config.junk-highlighter": "Junk Highlighter", + "firmament.config.junk-highlighter.description": "Highlight items using regex to search for items in your inventory", + "firmament.config.junk-highlighter.regex": "Search Regex", + "firmament.config.junk-highlighter.regex.description": "The RegEx (Regular Expression) to use when searching", + "firmament.config.junk-highlighter.highlight": "Highlight Keybind", + "firmament.config.junk-highlighter.highlight.description": "Highlight found items when this keybind is held", "firmament.debug.skyblockid": "SkyBlock ID: %s", "firmament.debug.skyblockid.copy": "Click to copy SkyBlock ID", "firmament.dev.resourcerebuild.done": "Gradle resource rebuild done in %s", -- cgit From 98a080099683f9354ec4e02e47ff39b30caa8590 Mon Sep 17 00:00:00 2001 From: Jacob <55346310+Kathund@users.noreply.github.com> Date: Tue, 12 Aug 2025 07:27:04 +0800 Subject: feat: block zapper overlay (#208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Linnea Gräf --- .../kotlin/features/items/BlockZapperOverlay.kt | 146 +++++++++++++++++++++ src/main/kotlin/util/render/CustomRenderLayers.kt | 1 + .../kotlin/util/render/RenderInWorldContext.kt | 115 +++++++++++----- src/main/kotlin/util/skyblock/SkyBlockItems.kt | 1 + translations/en_us.json | 7 + 5 files changed, 235 insertions(+), 35 deletions(-) create mode 100644 src/main/kotlin/features/items/BlockZapperOverlay.kt (limited to 'src/main/kotlin/features') diff --git a/src/main/kotlin/features/items/BlockZapperOverlay.kt b/src/main/kotlin/features/items/BlockZapperOverlay.kt new file mode 100644 index 0000000..c207d67 --- /dev/null +++ b/src/main/kotlin/features/items/BlockZapperOverlay.kt @@ -0,0 +1,146 @@ +package moe.nea.firmament.features.items + +import io.github.notenoughupdates.moulconfig.ChromaColour +import java.util.LinkedList +import net.minecraft.block.Block +import net.minecraft.block.BlockState +import net.minecraft.block.Blocks +import net.minecraft.util.hit.BlockHitResult +import net.minecraft.util.hit.HitResult +import net.minecraft.util.math.BlockPos +import moe.nea.firmament.annotations.Subscribe +import moe.nea.firmament.events.ClientStartedEvent +import moe.nea.firmament.events.WorldKeyboardEvent +import moe.nea.firmament.events.WorldRenderLastEvent +import moe.nea.firmament.features.FirmamentFeature +import moe.nea.firmament.gui.config.ManagedConfig +import moe.nea.firmament.util.MC +import moe.nea.firmament.util.render.RenderInWorldContext +import moe.nea.firmament.util.skyBlockId +import moe.nea.firmament.util.skyblock.SkyBlockItems + +object BlockZapperOverlay : FirmamentFeature { + override val identifier: String + get() = "block-zapper-overlay" + + object TConfig : ManagedConfig(identifier, Category.ITEMS) { + var blockZapperOverlay by toggle("block-zapper-overlay") { false } + val color by colour("color") { ChromaColour.fromStaticRGB(160, 0, 0, 60) } + var undoKey by keyBindingWithDefaultUnbound("undo-key") + } + + @Subscribe + fun onInit(event: ClientStartedEvent) { + } + + override val config: ManagedConfig + get() = TConfig + + val bannedZapper: List = listOf( + Blocks.WHEAT, + Blocks.CARROTS, + Blocks.POTATOES, + Blocks.PUMPKIN, + Blocks.PUMPKIN_STEM, + Blocks.MELON, + Blocks.MELON_STEM, + Blocks.CACTUS, + Blocks.SUGAR_CANE, + Blocks.NETHER_WART, + Blocks.TALL_GRASS, + Blocks.SUNFLOWER, + Blocks.FARMLAND, + Blocks.BREWING_STAND, + Blocks.SNOW, + Blocks.RED_MUSHROOM, + Blocks.BROWN_MUSHROOM, + ) + + private val zapperOffsets: List = listOf( + BlockPos(0, 0, -1), + BlockPos(0, 0, 1), + BlockPos(-1, 0, 0), + BlockPos(1, 0, 0), + BlockPos(0, 1, 0), + BlockPos(0, -1, 0) + ) + + // Skidded from NEU + // Credit: https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/9b1fcfebc646e9fb69f99006327faa3e734e5f51/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java#L1281-L1355 (Modified) + @Subscribe + fun renderBlockZapperOverlay(event: WorldRenderLastEvent) { + if (!TConfig.blockZapperOverlay) return + val player = MC.player ?: return + val world = player.world ?: return + val heldItem = MC.stackInHand + if (heldItem.skyBlockId != SkyBlockItems.BLOCK_ZAPPER) return + val hitResult = MC.instance.crosshairTarget ?: return + + val zapperBlocks: HashSet = HashSet() + val returnablePositions = LinkedList() + + if (hitResult is BlockHitResult && hitResult.type == HitResult.Type.BLOCK) { + var pos: BlockPos = hitResult.blockPos + val firstBlockState: BlockState = world.getBlockState(pos) + val block = firstBlockState.block + + val initialAboveBlock = world.getBlockState(pos.up()).block + if (!bannedZapper.contains(initialAboveBlock) && !bannedZapper.contains(block)) { + var i = 0 + while (i < 164) { + zapperBlocks.add(pos) + returnablePositions.remove(pos) + + val availableNeighbors: MutableList = ArrayList() + + for (offset in zapperOffsets) { + val newPos = pos.add(offset) + + if (zapperBlocks.contains(newPos)) continue + + val state: BlockState? = world.getBlockState(newPos) + if (state != null && state.block === block) { + val above = newPos.up() + val aboveBlock = world.getBlockState(above).block + if (!bannedZapper.contains(aboveBlock)) { + availableNeighbors.add(newPos) + } + } + } + + if (availableNeighbors.size >= 2) { + returnablePositions.add(pos) + pos = availableNeighbors[0] + } else if (availableNeighbors.size == 1) { + pos = availableNeighbors[0] + } else if (returnablePositions.isEmpty()) { + break + } else { + i-- + pos = returnablePositions.last() + } + + i++ + } + } + + RenderInWorldContext.renderInWorld(event) { + if (MC.player?.isSneaking ?: false) { + zapperBlocks.forEach { + block(it, TConfig.color.getEffectiveColourRGB()) + } + } else { + sharedVoxelSurface(zapperBlocks, TConfig.color.getEffectiveColourRGB()) + } + } + } + } + + @Subscribe + fun onWorldKeyboard(it: WorldKeyboardEvent) { + if (!TConfig.undoKey.isBound) return + if (!it.matches(TConfig.undoKey)) return + if (MC.stackInHand.skyBlockId != SkyBlockItems.BLOCK_ZAPPER) return + MC.sendCommand("undozap") + } +} diff --git a/src/main/kotlin/util/render/CustomRenderLayers.kt b/src/main/kotlin/util/render/CustomRenderLayers.kt index f713a81..2da1de7 100644 --- a/src/main/kotlin/util/render/CustomRenderLayers.kt +++ b/src/main/kotlin/util/render/CustomRenderLayers.kt @@ -88,6 +88,7 @@ object CustomRenderLayers { val COLORED_QUADS = RenderLayer.of( "firmament_quads", RenderLayer.DEFAULT_BUFFER_SIZE, + false, true, CustomRenderPipelines.COLORED_OMNIPRESENT_QUADS, RenderLayer.MultiPhaseParameters.builder() .lightmap(RenderPhase.DISABLE_LIGHTMAP) diff --git a/src/main/kotlin/util/render/RenderInWorldContext.kt b/src/main/kotlin/util/render/RenderInWorldContext.kt index 4963920..c30ee19 100644 --- a/src/main/kotlin/util/render/RenderInWorldContext.kt +++ b/src/main/kotlin/util/render/RenderInWorldContext.kt @@ -11,7 +11,6 @@ import net.minecraft.client.render.RenderLayer import net.minecraft.client.render.RenderTickCounter import net.minecraft.client.render.VertexConsumer import net.minecraft.client.render.VertexConsumerProvider -import net.minecraft.client.render.VertexFormats import net.minecraft.client.texture.Sprite import net.minecraft.client.util.math.MatrixStack import net.minecraft.text.Text @@ -20,7 +19,6 @@ import net.minecraft.util.math.BlockPos import net.minecraft.util.math.Vec3d import moe.nea.firmament.events.WorldRenderLastEvent import moe.nea.firmament.util.FirmFormatters -import moe.nea.firmament.util.IntUtil.toRGBA import moe.nea.firmament.util.MC @RenderContextDSL @@ -49,6 +47,38 @@ class RenderInWorldContext private constructor( matrixStack.pop() } + fun sharedVoxelSurface(blocks: Set, color: Int) { + val m = BlockPos.Mutable() + val l = vertexConsumers.getBuffer(CustomRenderLayers.COLORED_QUADS) + blocks.forEach { + matrixStack.push() + matrixStack.translate(it.x.toFloat(), it.y.toFloat(), it.z.toFloat()) + val p = matrixStack.peek().positionMatrix + m.set(it) + if (m.setX(it.x + 1) !in blocks) { + buildFaceXP(p, l, color) + } + if (m.setX(it.x - 1) !in blocks) { + buildFaceXN(p, l, color) + } + m.set(it) + if (m.setY(it.y + 1) !in blocks) { + buildFaceYP(p, l, color) + } + if (m.setY(it.y - 1) !in blocks) { + buildFaceYN(p, l, color) + } + m.set(it) + if (m.setZ(it.z + 1) !in blocks) { + buildFaceZP(p, l, color) + } + if (m.setZ(it.z - 1) !in blocks) { + buildFaceZN(p, l, color) + } + matrixStack.pop() + } + } + enum class VerticalAlign { TOP, BOTTOM, CENTER; @@ -205,41 +235,56 @@ class RenderInWorldContext private constructor( } } - private fun buildCube(matrix: Matrix4f, buf: VertexConsumer, colorInt: Int) { - val (r, g, b, a) = colorInt.toRGBA() - - // Y- - buf.vertex(matrix, 0F, 0F, 0F).color(r, g, b, a) - buf.vertex(matrix, 0F, 0F, 1F).color(r, g, b, a) - buf.vertex(matrix, 1F, 0F, 1F).color(r, g, b, a) - buf.vertex(matrix, 1F, 0F, 0F).color(r, g, b, a) - // Y+ - buf.vertex(matrix, 0F, 1F, 0F).color(r, g, b, a) - buf.vertex(matrix, 1F, 1F, 0F).color(r, g, b, a) - buf.vertex(matrix, 1F, 1F, 1F).color(r, g, b, a) - buf.vertex(matrix, 0F, 1F, 1F).color(r, g, b, a) - // X- - buf.vertex(matrix, 0F, 0F, 0F).color(r, g, b, a) - buf.vertex(matrix, 0F, 0F, 1F).color(r, g, b, a) - buf.vertex(matrix, 0F, 1F, 1F).color(r, g, b, a) - buf.vertex(matrix, 0F, 1F, 0F).color(r, g, b, a) - // X+ - buf.vertex(matrix, 1F, 0F, 0F).color(r, g, b, a) - buf.vertex(matrix, 1F, 1F, 0F).color(r, g, b, a) - buf.vertex(matrix, 1F, 1F, 1F).color(r, g, b, a) - buf.vertex(matrix, 1F, 0F, 1F).color(r, g, b, a) - // Z- - buf.vertex(matrix, 0F, 0F, 0F).color(r, g, b, a) - buf.vertex(matrix, 1F, 0F, 0F).color(r, g, b, a) - buf.vertex(matrix, 1F, 1F, 0F).color(r, g, b, a) - buf.vertex(matrix, 0F, 1F, 0F).color(r, g, b, a) - // Z+ - buf.vertex(matrix, 0F, 0F, 1F).color(r, g, b, a) - buf.vertex(matrix, 0F, 1F, 1F).color(r, g, b, a) - buf.vertex(matrix, 1F, 1F, 1F).color(r, g, b, a) - buf.vertex(matrix, 1F, 0F, 1F).color(r, g, b, a) + private fun buildFaceZP(matrix: Matrix4f, buf: VertexConsumer, rgba: Int) { + buf.vertex(matrix, 0F, 0F, 1F).color(rgba) + buf.vertex(matrix, 0F, 1F, 1F).color(rgba) + buf.vertex(matrix, 1F, 1F, 1F).color(rgba) + buf.vertex(matrix, 1F, 0F, 1F).color(rgba) + } + + private fun buildFaceZN(matrix: Matrix4f, buf: VertexConsumer, rgba: Int) { + buf.vertex(matrix, 0F, 0F, 0F).color(rgba) + buf.vertex(matrix, 1F, 0F, 0F).color(rgba) + buf.vertex(matrix, 1F, 1F, 0F).color(rgba) + buf.vertex(matrix, 0F, 1F, 0F).color(rgba) + } + + private fun buildFaceXP(matrix: Matrix4f, buf: VertexConsumer, rgba: Int) { + buf.vertex(matrix, 1F, 0F, 0F).color(rgba) + buf.vertex(matrix, 1F, 1F, 0F).color(rgba) + buf.vertex(matrix, 1F, 1F, 1F).color(rgba) + buf.vertex(matrix, 1F, 0F, 1F).color(rgba) + } + + private fun buildFaceXN(matrix: Matrix4f, buf: VertexConsumer, rgba: Int) { + buf.vertex(matrix, 0F, 0F, 0F).color(rgba) + buf.vertex(matrix, 0F, 0F, 1F).color(rgba) + buf.vertex(matrix, 0F, 1F, 1F).color(rgba) + buf.vertex(matrix, 0F, 1F, 0F).color(rgba) } + private fun buildFaceYN(matrix: Matrix4f, buf: VertexConsumer, rgba: Int) { + buf.vertex(matrix, 0F, 0F, 0F).color(rgba) + buf.vertex(matrix, 0F, 0F, 1F).color(rgba) + buf.vertex(matrix, 1F, 0F, 1F).color(rgba) + buf.vertex(matrix, 1F, 0F, 0F).color(rgba) + } + + private fun buildFaceYP(matrix: Matrix4f, buf: VertexConsumer, rgba: Int) { + buf.vertex(matrix, 0F, 1F, 0F).color(rgba) + buf.vertex(matrix, 1F, 1F, 0F).color(rgba) + buf.vertex(matrix, 1F, 1F, 1F).color(rgba) + buf.vertex(matrix, 0F, 1F, 1F).color(rgba) + } + + private fun buildCube(matrix4f: Matrix4f, buf: VertexConsumer, rgba: Int) { + buildFaceXP(matrix4f, buf, rgba) + buildFaceXN(matrix4f, buf, rgba) + buildFaceYP(matrix4f, buf, rgba) + buildFaceYN(matrix4f, buf, rgba) + buildFaceZP(matrix4f, buf, rgba) + buildFaceZN(matrix4f, buf, rgba) + } fun renderInWorld(event: WorldRenderLastEvent, block: RenderInWorldContext. () -> Unit) { // TODO: there should be *no more global state*. the only thing we should be doing is render layers. that includes settings like culling, blending, shader color, and depth testing diff --git a/src/main/kotlin/util/skyblock/SkyBlockItems.kt b/src/main/kotlin/util/skyblock/SkyBlockItems.kt index d552fd7..32c4aab 100644 --- a/src/main/kotlin/util/skyblock/SkyBlockItems.kt +++ b/src/main/kotlin/util/skyblock/SkyBlockItems.kt @@ -19,5 +19,6 @@ object SkyBlockItems { val BONE_BOOMERANG = SkyblockId("BONE_BOOMERANG") val STARRED_BONE_BOOMERANG = SkyblockId("STARRED_BONE_BOOMERANG") val TRIBAL_SPEAR = SkyblockId("TRIBAL_SPEAR") + val BLOCK_ZAPPER = SkyblockId("BLOCK_ZAPPER") val HUNTING_TOOLKIT = SkyblockId("HUNTING_TOOLKIT") } diff --git a/translations/en_us.json b/translations/en_us.json index c18c2f7..b902206 100644 --- a/translations/en_us.json +++ b/translations/en_us.json @@ -24,6 +24,13 @@ "firmament.config.auto-completions.warp-complete.description": "Auto complete warp destinations in chat. This may include warps you have not yet unlocked.", "firmament.config.auto-completions.warp-is": "Redirect /warp is to /warp island", "firmament.config.auto-completions.warp-is.description": "Redirects /warp is to /warp island, since hypixel does not recognize /warp is as a warp destination.", + "firmament.config.block-zapper-overlay": "Block Zapper Overlay", + "firmament.config.block-zapper-overlay.block-zapper-overlay": "Block Zapper Overlay", + "firmament.config.block-zapper-overlay.block-zapper-overlay.description": "Shows what blocks will be zapped", + "firmament.config.block-zapper-overlay.color": "Colour", + "firmament.config.block-zapper-overlay.color.description": "The color that the blocks will be highlighted in", + "firmament.config.block-zapper-overlay.undo-key": "Undo Keybind", + "firmament.config.block-zapper-overlay.undo-key.description": "Keybind to undo your zap", "firmament.config.bonemerang-overlay": "Bonemerang Overlay", "firmament.config.bonemerang-overlay.bonemerang-overlay": "Bonemerang Overlay", "firmament.config.bonemerang-overlay.bonemerang-overlay-hud": "Bonemerang Overlay Hud", -- cgit