Applied Energistics 2

Applied Energistics 2

137M Downloads

Craftable items are not displayed in wireless terminals

Mari023 opened this issue ยท 1 comments

commented

they are displayed in normal terminals tho

commented

I think that this happens because the network node is never set in MEMonitorableMenu if the host is an IPortableTerminal

if (host instanceof IPortableTerminal || host instanceof IMEChest) {
powerSource = (IEnergySource) host;
} else if (host instanceof IActionHost actionHost) {
var node = actionHost.getActionableNode();
if (node != null) {
this.networkNode = node;
var g = node.getGrid();
if (g != null) {
powerSource = new ChannelPowerSrc(this.networkNode, g.getEnergyService());
}
}
}

although I guess it might be better to not permanently store the grid node, since it can change?

using getNetworkNode() instead of the stored node would solve this

private Set<AEKey> getCraftablesFromGrid() {
if (networkNode != null && networkNode.isActive()) {
return networkNode.getGrid().getCraftingService().getCraftables(this::isKeyVisible);
}
return Collections.emptySet();
}

actually this would only work for my terminals (including ae2's crafting terminal)
getCraftablesFromGrid() has to do it similar to updateActiveCraftingJobs()

private void updateActiveCraftingJobs() {
IGridNode hostNode = networkNode;
// Wireless terminals do not directly expose the target grid (even though they
// have one)
if (hostNode == null && host instanceof IActionHost) {
hostNode = ((IActionHost) host).getActionableNode();
}

alternatively, it might make sense to change getNetworkNode() to just account for this