mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
heatable fluid trait, steam compression headaches
This commit is contained in:
parent
3ef8533142
commit
ab083eec59
@ -8,6 +8,7 @@ import com.hbm.inventory.fluid.FluidType.ExtContainer;
|
|||||||
import com.hbm.inventory.fluid.trait.*;
|
import com.hbm.inventory.fluid.trait.*;
|
||||||
import com.hbm.inventory.fluid.trait.FluidTraitSimple.*;
|
import com.hbm.inventory.fluid.trait.FluidTraitSimple.*;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade;
|
import com.hbm.inventory.fluid.trait.FT_Combustible.FuelGrade;
|
||||||
|
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
|
||||||
import com.hbm.render.util.EnumSymbol;
|
import com.hbm.render.util.EnumSymbol;
|
||||||
|
|
||||||
public class Fluids {
|
public class Fluids {
|
||||||
@ -300,6 +301,11 @@ public class Fluids {
|
|||||||
metaOrder.add(PLASMA_XM);
|
metaOrder.add(PLASMA_XM);
|
||||||
metaOrder.add(PLASMA_BF);
|
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));
|
||||||
|
|
||||||
if(idMapping.size() != metaOrder.size()) {
|
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());
|
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());
|
||||||
}
|
}
|
||||||
|
|||||||
73
src/main/java/com/hbm/inventory/fluid/trait/FT_Heatable.java
Normal file
73
src/main/java/com/hbm/inventory/fluid/trait/FT_Heatable.java
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
package com.hbm.inventory.fluid.trait;
|
||||||
|
|
||||||
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
|
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class FT_Heatable extends FluidTrait {
|
||||||
|
|
||||||
|
protected List<HeatingStep> steps = new ArrayList();
|
||||||
|
protected HashMap<HeatingType, Double> efficiency = new HashMap();
|
||||||
|
|
||||||
|
/** Add in ascending order, lowest heat required goes first! */
|
||||||
|
public FT_Heatable addStep(int heat, int req, FluidType type, int prod) {
|
||||||
|
steps.add(new HeatingStep(req, heat, type, prod));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** sets efficiency for different types of heating, main difference is with water */
|
||||||
|
public FT_Heatable setEff(HeatingType type, double eff) {
|
||||||
|
efficiency.put(type, eff);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getEfficiency(HeatingType type) {
|
||||||
|
Double eff = this.efficiency.get(type);
|
||||||
|
return eff != null ? eff : 0.0D;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HeatingStep getFirstStep() {
|
||||||
|
return this.steps.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addInfoHidden(List<String> info) {
|
||||||
|
for(HeatingType type : HeatingType.values()) {
|
||||||
|
|
||||||
|
double eff = getEfficiency(type);
|
||||||
|
|
||||||
|
if(eff > 0) {
|
||||||
|
info.add(EnumChatFormatting.AQUA + "[" + type.name + "]");
|
||||||
|
info.add(EnumChatFormatting.AQUA + "Efficiency: " + ((int) (eff * 100D)) + "%");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class HeatingStep {
|
||||||
|
public final int amountReq;
|
||||||
|
public final int heatReq;
|
||||||
|
public final FluidType typeProduced;
|
||||||
|
public final int amountProduced;
|
||||||
|
|
||||||
|
public HeatingStep(int req, int heat, FluidType type, int prod) {
|
||||||
|
this.amountReq = req;
|
||||||
|
this.heatReq = heat;
|
||||||
|
this.typeProduced = type;
|
||||||
|
this.amountProduced = prod;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static enum HeatingType {
|
||||||
|
BOILER("Boilable"),
|
||||||
|
HEATEXCHANGER("Heatable");
|
||||||
|
|
||||||
|
public String name;
|
||||||
|
|
||||||
|
private HeatingType(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user