if(conduit.getExternalConnections().isEmpty()) {
sb.append(ITEM_HEADING);
sb.append(" ");
sb.append(ITEM_NO_CONNECTIONS);
sb.append("\n");
player.addChatComponentMessage(new ChatComponentText(sb.toString()));
return;
}
for (ForgeDirection dir : conduit.getExternalConnections()) {
ConnectionMode mode = conduit.getConnectionMode(dir);
sb.append(ITEM_HEADING);
sb.append(" ");
sb.append(Lang.localize("gui.mjReader.connectionDir"));
sb.append(" ");
sb.append(dir);
sb.append("\n");
ItemConduitNetwork icn = (ItemConduitNetwork) conduit.getNetwork();
if(mode.acceptsInput()) {
color = "\u00A79 ";
sb.append(color);
if(input == null) {
sb.append(Lang.localize("gui.mjReader.extractedItems"));
} else {
sb.append(Lang.localize("gui.mjReader.extractedItem"));
sb.append(" ");
sb.append(input.getDisplayName());
}
sb.append(" ");
List<String> targets = icn.getTargetsForExtraction(conduit.getLocation().getLocation(dir), conduit, input);
if(targets.isEmpty()) {
sb.append(" ");
sb.append(Lang.localize("gui.mjReader.noOutputs"));
sb.append(".\n");
} else {
sb.append(" ");
sb.append(Lang.localize("gui.mjReader.insertedInto"));
sb.append("\n");
for (String str : targets) {
sb.append(" - ");
sb.append(str);
sb.append(" ");
sb.append("\n");
}
}
}
if(mode.acceptsOutput()) {
color = "\u00A79 ";
sb.append(color);
List<String> targets = icn.getInputSourcesFor(conduit, dir, input);
if(targets.isEmpty()) {
if(input == null) {
sb.append(Lang.localize("gui.mjReader.noItems"));
} else {
sb.append(Lang.localize("gui.mjReader.noItem"));
sb.append(" ");
sb.append(input.getDisplayName());
}
} else {
if(input == null) {
sb.append(Lang.localize("gui.mjReader.receiveItems"));
} else {
sb.append(Lang.localize("gui.mjReader.receiveItem1"));
sb.append(" ");
sb.append(input.getDisplayName());
sb.append(" ");
sb.append(Lang.localize("gui.mjReader.receiveItem2"));
}
sb.append("\n");
for (String str : targets) {
sb.append(" - ");
sb.append(str);
sb.append("\n");
}
}
}
}
String[] lines = sb.toString().split("\n");
for(String line : lines) {
player.addChatComponentMessage(new ChatComponentText(line));
}
}