the thicc NEI handler that does nothing except render things thicc

This commit is contained in:
Boblet 2022-10-06 13:08:27 +02:00
parent ab083eec59
commit 8ca1513bf8
4 changed files with 91 additions and 10 deletions

View File

@ -1,5 +1,7 @@
package com.hbm.handler.nei;
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
@ -9,6 +11,7 @@ import codechicken.nei.guihook.GuiContainerManager;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.item.ItemStack;
public class ChunkyHandler extends TemplateRecipeHandler {
@ -30,7 +33,7 @@ public class ChunkyHandler extends TemplateRecipeHandler {
@Override
public String getRecipeName() {
return "The same thing but in big";
return "";
}
@Override
@ -51,12 +54,23 @@ public class ChunkyHandler extends TemplateRecipeHandler {
@Override
public void drawExtras(int recipe) {
RecipeSet rec = (RecipeSet) this.arecipes.get(recipe);
drawTexturedModalRect(145, 0, 20, 20, 20, 20);
GL11.glPushMatrix();
double scale = 10D;
GL11.glTranslated(83, 50, 0);
double scale = 5D;
GL11.glScaled(scale, scale, scale);
GuiContainerManager.drawItem(50, 50, rec.stack); //TODO: center properly
RenderHelper.enableGUIStandardItemLighting();
GL11.glTranslated(-8, -8, 0);
GuiContainerManager.drawItem(0, 0, rec.stack);
GL11.glPopMatrix();
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
fontRenderer.drawString("so you can really stare at it", 52, 100, 0x404040);
RenderHelper.enableGUIStandardItemLighting();
FontRenderer font = Minecraft.getMinecraft().fontRenderer;
int w = 83;
String top = "The same thing but in big";
String bottom = "so you can really stare at it";
font.drawString(top, w - font.getStringWidth(top) / 2, 100, 0x404040);
font.drawString(bottom, w - font.getStringWidth(bottom) / 2, 110, 0x404040);
}
}

View File

@ -301,10 +301,21 @@ public class Fluids {
metaOrder.add(PLASMA_XM);
metaOrder.add(PLASMA_BF);
WATER.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, 1.0D).setEff(HeatingType.HEATEXCHANGER, 0.25D)
.addStep(20, 1, Fluids.STEAM, 100)
.addStep(220, 1, Fluids.HOTSTEAM, 10)
.addStep(220, 1, Fluids.SUPERHOTSTEAM, 1));
double eff_steam_boil = 1.0D;
double eff_steam_heatex = 0.25D;
WATER.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, eff_steam_boil).setEff(HeatingType.HEATEXCHANGER, eff_steam_heatex)
.addStep(200, 1, STEAM, 100)
.addStep(220, 1, HOTSTEAM, 10)
.addStep(238, 1, SUPERHOTSTEAM, 1)
.addStep(2500, 10, ULTRAHOTSTEAM, 1));
STEAM.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, eff_steam_boil).setEff(HeatingType.HEATEXCHANGER, eff_steam_heatex).addStep(2, 10, HOTSTEAM, 1));
HOTSTEAM.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, eff_steam_boil).setEff(HeatingType.HEATEXCHANGER, eff_steam_heatex).addStep(18, 10, SUPERHOTSTEAM, 1));
SUPERHOTSTEAM.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, eff_steam_boil).setEff(HeatingType.HEATEXCHANGER, eff_steam_heatex).addStep(120, 10, ULTRAHOTSTEAM, 1));
OIL.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, 1.0D).setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(10, 1, HOTOIL, 1));
CRACKOIL.addTraits(new FT_Heatable().setEff(HeatingType.BOILER, 1.0D).setEff(HeatingType.HEATEXCHANGER, 1.0D).addStep(10, 1, HOTCRACKOIL, 1));
if(idMapping.size() != metaOrder.size()) {
throw new IllegalStateException("A severe error has occoured during NTM's fluid registering process! The MetaOrder and Mappings are inconsistent! Mapping size: " + idMapping.size()+ " / MetaOrder size: " + metaOrder.size());

View File

@ -0,0 +1,55 @@
package com.hbm.inventory.fluid.trait;
import java.util.HashMap;
import java.util.List;
import com.hbm.inventory.fluid.FluidType;
import net.minecraft.util.EnumChatFormatting;
public class FT_Coolable extends FluidTrait {
protected HashMap<CoolingType, Double> efficiency = new HashMap();
public final FluidType coolsTo;
public final int heatEnergy;
public FT_Coolable(FluidType type, int heat) {
this.coolsTo = type;
this.heatEnergy = heat;
}
public FT_Coolable setEff(CoolingType type, double eff) {
efficiency.put(type, eff);
return this;
}
public double getEfficiency(CoolingType type) {
Double eff = this.efficiency.get(type);
return eff != null ? eff : 0.0D;
}
@Override
public void addInfoHidden(List<String> info) {
for(CoolingType type : CoolingType.values()) {
double eff = getEfficiency(type);
if(eff > 0) {
info.add(EnumChatFormatting.AQUA + "[" + type.name + "]");
info.add(EnumChatFormatting.AQUA + "Efficiency: " + ((int) (eff * 100D)) + "%");
}
}
}
public static enum CoolingType {
TURBINE("Turbine Steam"),
HEATEXCHANGER("Coolable");
public String name;
private CoolingType(String name) {
this.name = name;
}
}
}

View File

@ -33,7 +33,8 @@ public class FT_Heatable extends FluidTrait {
public HeatingStep getFirstStep() {
return this.steps.get(0);
}
@Override
public void addInfoHidden(List<String> info) {
for(HeatingType type : HeatingType.values()) {