From 8da6474b38a2758355c78d460c483ddabcae6a9c Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Sat, 12 Apr 2025 20:05:10 -0700 Subject: [PATCH] nicer formatting for structure blockstates --- scripts/classes/BlockInfo.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/classes/BlockInfo.js b/scripts/classes/BlockInfo.js index c063592..57ca8eb 100644 --- a/scripts/classes/BlockInfo.js +++ b/scripts/classes/BlockInfo.js @@ -21,7 +21,11 @@ class BlockInfo { const states = block.getAllStates(); if (Object.keys(states).length === 0) return `Structure:\n§a${block.type.id}`; - return `Structure:\n§a${block.type.id}\n§7${JSON.stringify(block.getAllStates())}`; + return `Structure:\n§a${block.type.id}\n§7${this.getFormattedStates(states)}`; + } + + static getFormattedStates(states) { + return Object.entries(states).map(([key, value]) => `§7${key}: ${value}`).join('\n'); } }