Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
added macerator info renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 1, 2024
1 parent e317468 commit f5c5d41
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions common/src/main/java/muramasa/gregtech/data/RecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,30 @@ public int getRows() {
}
};

public static final IRecipeInfoRenderer MACERATOR_RENDERER = new IRecipeInfoRenderer() {
public void render(PoseStack stack, IRecipe recipe, Font fontRenderer, int guiOffsetX, int guiOffsetY) {
if (recipe.getDuration() == 0 && recipe.getPower() == 0) return;
String additional = recipe.getDuration() < 1200 ? "" : recipe.getDuration() < 36000 ? " (" + (recipe.getDuration() / 20.0f) + " secs)" : " (" + (recipe.getDuration() / 1200.0f) + " mins)";
String power = "Duration: " + recipe.getDuration() + " ticks" + additional;
String euT = "EU/t: " + recipe.getPower();
String amps = "Amps: " + recipe.getAmps();
String total = "Total: " + recipe.getPower() * recipe.getDuration() + " EU";
Tier tier = Tier.getTier((recipe.getPower() / recipe.getAmps()));
String formattedText = " (" + tier.getId().toUpperCase() + ")";
renderString(stack, power, fontRenderer, 5, 0, guiOffsetX, guiOffsetY);
renderString(stack, euT, fontRenderer, 5, 10, guiOffsetX, guiOffsetY);
renderString(stack, formattedText, fontRenderer, 5 + stringWidth(euT, fontRenderer), 10, Tier.EV.getRarityFormatting().getColor(), guiOffsetX, guiOffsetY);
renderString(stack, amps, fontRenderer, 5, 20, guiOffsetX, guiOffsetY);
renderString(stack, total, fontRenderer, 5, 30, guiOffsetX, guiOffsetY);
renderString(stack, "Secondary outputs only available in pulverizers and large macerator", fontRenderer, 5, 40, guiOffsetX, guiOffsetY);
}

@Override
public int getRows() {
return 5;
}
};

static {
SOLID_FUEL_BOILERS.setGuiData(SIMPLE_DISPLAY);
COMBUSTION_FUELS.setGuiData(Guis.MULTI_DISPLAY);
Expand Down Expand Up @@ -368,6 +392,7 @@ public static void clientMaps() {
HEAT_EXCHANGER.setInfoRenderer(HEAT_EXCHANGER_RENDERER);
FUSION.setInfoRenderer(FUSION_RENDERER);
CHEMICAL_REACTOR.setInfoRenderer(CHEM_RENDERER);
PULVERIZER.setInfoRenderer(MACERATOR_RENDERER);
}

public static class PulverizerBulder extends RecipeBuilder{
Expand Down

0 comments on commit f5c5d41

Please sign in to comment.