@@ -380,7 +380,7 @@ private void identifyChokepoints() {
380380 World nodeWorld = getNodeWorld(bfsNode.gridNode);
381381 IBlockState blockState = (nodeWorld != null && nodeWorld.isBlockLoaded(pos))
382382 ? nodeWorld.getBlockState(pos) : Blocks.AIR.getDefaultState();
383- String description = getNodeDescription(bfsNode.gridNode.getMachine() );
383+ String description = getNodeDescription(bfsNode.gridNode);
384384
385385 ChannelChokepoint chokepoint = new ChannelChokepoint(
386386 pos, dimension, dimName, blockState, description,
@@ -423,7 +423,7 @@ private void identifyMissingChannelDevices() {
423423 // Fall back to empty stack
424424 }
425425
426- String description = getNodeDescription(node.getMachine() );
426+ String description = getNodeDescription(node);
427427 MissingChannelDevice device = new MissingChannelDevice(
428428 pos, dimension, dimName, itemStack, description
429429 );
@@ -439,7 +439,7 @@ private void addConnectionFlows(ChannelChokepoint chokepoint, BfsNode bfsNode) {
439439 if (bfsNode.parent != null) {
440440 BlockPos parentPos = getNodePosition(bfsNode.parent.gridNode);
441441 EnumFacing direction = getConnectionDirection(bfsNode.gridNode, bfsNode.connectionFromParent);
442- String parentDesc = getNodeDescription(bfsNode.parent.gridNode.getMachine() );
442+ String parentDesc = getNodeDescription(bfsNode.parent.gridNode);
443443
444444 // Parent carries all the demand (toward controller)
445445 int parentChannels = bfsNode.connectionFromParent != null
@@ -457,7 +457,7 @@ private void addConnectionFlows(ChannelChokepoint chokepoint, BfsNode bfsNode) {
457457 for (BfsNode child : bfsNode.children) {
458458 BlockPos childPos = getNodePosition(child.gridNode);
459459 EnumFacing direction = getConnectionDirection(bfsNode.gridNode, child.connectionFromParent);
460- String childDesc = getNodeDescription(child.gridNode.getMachine() );
460+ String childDesc = getNodeDescription(child.gridNode);
461461
462462 int childChannels = child.connectionFromParent != null
463463 ? child.connectionFromParent.getUsedChannels() : 0;
@@ -513,8 +513,22 @@ private BlockPos getNodePosition(IGridNode node) {
513513
514514 /**
515515 * Get a human-readable description of a grid node.
516+ * Uses the machine representation's display name for localized output.
516517 */
517- private String getNodeDescription(IGridHost host) {
518+ private String getNodeDescription(IGridNode node) {
519+ if (node == null) return I18n.translateToLocal("ae2powertools.common.unknown");
520+
521+ // Try to get the localized name from the machine representation
522+ try {
523+ ItemStack representation = node.getGridBlock().getMachineRepresentation();
524+
525+ if (!representation.isEmpty()) return representation.getDisplayName();
526+ } catch (Exception e) {
527+ // Fall through to class name fallback
528+ }
529+
530+ // Fallback: clean up class name
531+ IGridHost host = node.getMachine();
518532 if (host == null) return I18n.translateToLocal("ae2powertools.common.unknown");
519533
520534 String className = host.getClass().getSimpleName();
0 commit comments