use of forestry.api.circuits.ICircuitSocketType in project ForestryMC by ForestryMC.
the class GuiSolderingIron method drawGuiContainerBackgroundLayer.
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) {
super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY);
ICircuitLayout layout = ((ContainerSolderingIron) inventorySlots).getLayout();
String title = layout.getName();
fontRenderer.drawString(title, guiLeft + 8 + textLayout.getCenteredOffset(title, 138), guiTop + 16, ColourProperties.INSTANCE.get("gui.screen"));
for (int i = 0; i < 4; i++) {
String description;
ItemStack tube = itemInventory.getStackInSlot(i + 2);
CircuitRecipe recipe = SolderManager.getMatchingRecipe(layout, tube);
if (recipe == null) {
description = "(" + Translator.translateToLocal("for.gui.noeffect") + ")";
} else {
description = recipe.getCircuit().getLocalizedName();
}
int row = i * 20;
fontRenderer.drawString(description, guiLeft + 32, guiTop + 36 + row, ColourProperties.INSTANCE.get("gui.screen"));
if (tube.isEmpty()) {
ICircuitSocketType socketType = layout.getSocketType();
if (CircuitSocketType.FARM.equals(socketType)) {
FarmDirection farmDirection = FarmDirection.values()[i];
String farmDirectionString = farmDirection.toString().toLowerCase(Locale.ENGLISH);
String localizedDirection = Translator.translateToLocal("for.gui.solder." + farmDirectionString);
fontRenderer.drawString(localizedDirection, guiLeft + 17, guiTop + 36 + row, ColourProperties.INSTANCE.get("gui.screen"));
}
}
}
}
Aggregations