Merge remote-tracking branch 'HbmMods/master'

This commit is contained in:
Vaern 2022-04-26 18:29:22 -07:00
commit b171943eb7
9 changed files with 81 additions and 17 deletions

View File

@ -18,8 +18,11 @@ public class FluidType {
//The numeric ID of the fluid
private int id;
//The internal name
private String stringId;
//Approximate HEX Color of the fluid, used for pipe rendering
private int color;
//The color for containers, not the liquid itself. Used for canisters.
private int containerColor = 0xffffff;
//Unlocalized string ID of the fluid
private String unlocalized;
@ -28,11 +31,20 @@ public class FluidType {
public int flammability;
public int reactivity;
public EnumSymbol symbol;
public int temperature;
public double heatCap;
public static final int ROOM_TEMPERATURE = 20;
public static final double DEFAULT_HEATCAP = 0.01D;
public static final double DEFAULT_COMPRESSION = 1D;
/** How hot this fluid is. Simple enough. */
public int temperature = ROOM_TEMPERATURE;
/** How much heat energy each mB requires to be heated by 1°C. Total heat energy = heatCap * delta-T. */
public double heatCap = DEFAULT_HEATCAP;
/** How much "stuff" there is in one mB. 1mB of water turns into 100mB of steam, therefore steam has a compression of 0.01. Compression is only used for translating fluids into other fluids, heat calculations should ignore this. */
public double compression = DEFAULT_COMPRESSION;
public Set<ExtContainer> containers = new HashSet();
public List<FluidTrait> traits = new ArrayList();
private String stringId;
private ResourceLocation texture;
@ -67,6 +79,11 @@ public class FluidType {
return this;
}
public FluidType setCompression(double compression) {
this.compression = compression;
return this;
}
public FluidType addContainers(int color, ExtContainer... containers) {
this.containerColor = color;
Collections.addAll(this.containers, containers);
@ -145,8 +162,10 @@ public class FluidType {
public void addInfo(List<String> info) {
if(temperature < 0) info.add(EnumChatFormatting.BLUE + "" + temperature + "°C");
if(temperature > 0) info.add(EnumChatFormatting.RED + "" + temperature + "°C");
if(temperature != ROOM_TEMPERATURE) {
if(temperature < 0) info.add(EnumChatFormatting.BLUE + "" + temperature + "°C");
if(temperature > 0) info.add(EnumChatFormatting.RED + "" + temperature + "°C");
}
if(isAntimatter()) info.add(EnumChatFormatting.DARK_RED + "Antimatter");
if(traits.contains(FluidTrait.CORROSIVE_2)) info.add(EnumChatFormatting.GOLD + "Strongly Corrosive");

View File

@ -112,10 +112,10 @@ public class Fluids {
NONE = new FluidType( "NONE", 0x888888, 0, 0, 0, EnumSymbol.NONE);
WATER = new FluidType( "WATER", 0x3333FF, 0, 0, 0, EnumSymbol.NONE);
STEAM = new FluidType( "STEAM", 0xe5e5e5, 3, 0, 0, EnumSymbol.NONE).setTemp(100);
HOTSTEAM = new FluidType( "HOTSTEAM", 0xE7D6D6, 4, 0, 0, EnumSymbol.NONE).setTemp(300);
SUPERHOTSTEAM = new FluidType( "SUPERHOTSTEAM", 0xE7B7B7, 4, 0, 0, EnumSymbol.NONE).setTemp(450);
ULTRAHOTSTEAM = new FluidType( "ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600);
STEAM = new FluidType( "STEAM", 0xe5e5e5, 3, 0, 0, EnumSymbol.NONE).setTemp(100).setCompression(0.01D);
HOTSTEAM = new FluidType( "HOTSTEAM", 0xE7D6D6, 4, 0, 0, EnumSymbol.NONE).setTemp(300).setCompression(0.1D);
SUPERHOTSTEAM = new FluidType( "SUPERHOTSTEAM", 0xE7B7B7, 4, 0, 0, EnumSymbol.NONE).setTemp(450).setCompression(1D);
ULTRAHOTSTEAM = new FluidType( "ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600).setCompression(10D);
COOLANT = new FluidType( "COOLANT", 0xd8fcff, 1, 0, 0, EnumSymbol.NONE).setHeatCap(0.25D);
LAVA = new FluidType( "LAVA", 0xFF3300, 4, 0, 0, EnumSymbol.NOWATER).setTemp(1200);
DEUTERIUM = new FluidTypeCombustible( "DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 10_000).setHeatEnergy(5_000);
@ -158,7 +158,7 @@ public class Fluids {
WASTEGAS = new FluidType( "WASTEGAS", 0xB8B8B8, 2, 0, 1, EnumSymbol.RADIATION).addTraits(FluidTrait.NO_CONTAINER);
GASOLINE = new FluidTypeCombustible( "GASOLINE", 0x445772, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 1_000_000).setHeatEnergy(400_000).addContainers(0x2F7747, ExtContainer.CANISTER);
COALGAS = new FluidTypeCombustible( "COALGAS", 0x445772, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.MEDIUM, 150_000).setHeatEnergy(75_000);
SPENTSTEAM = new FluidType( "SPENTSTEAM", 0x445772, 2, 0, 0, EnumSymbol.NONE).addTraits(FluidTrait.NO_CONTAINER);
SPENTSTEAM = new FluidType( "SPENTSTEAM", 0x445772, 2, 0, 0, EnumSymbol.NONE).addTraits(FluidTrait.NO_CONTAINER).setCompression(1D);
FRACKSOL = new FluidType( "FRACKSOL", 0x798A6B, 1, 3, 3, EnumSymbol.ACID).addTraits(FluidTrait.CORROSIVE).addContainers(0x4F887F, ExtContainer.CANISTER);
PLASMA_DT = new FluidType( "PLASMA_DT", 0xF7AFDE, 0, 4, 0, EnumSymbol.RADIATION).setTemp(3250).addTraits(FluidTrait.NO_CONTAINER, FluidTrait.NO_ID);
PLASMA_HD = new FluidType( "PLASMA_HD", 0xF0ADF4, 0, 4, 0, EnumSymbol.RADIATION).setTemp(2500).addTraits(FluidTrait.NO_CONTAINER, FluidTrait.NO_ID);
@ -186,7 +186,7 @@ public class Fluids {
GASOLINE_LEADED = new FluidTypeCombustible( "GASOLINE_LEADED", 0x445772, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 1_500_000).setHeatEnergy(((FluidTypeFlammable)GASOLINE).getHeatEnergy());
COALGAS_LEADED = new FluidTypeCombustible( "COALGAS_LEADED", 0x445772, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.MEDIUM, 250_000).setHeatEnergy(((FluidTypeFlammable)COALGAS).getHeatEnergy());
SULFURIC_ACID = new FluidType( "SULFURIC_ACID", 0xB0AA64, 3, 0, 2, EnumSymbol.ACID).addTraits(FluidTrait.CORROSIVE);
COOLANT_HOT = new FluidType( "COOLANT_HOT", 0x99525E, 1, 0, 0, EnumSymbol.NONE).setTemp(600).setHeatCap(STEAM.heatCap);
COOLANT_HOT = new FluidType( "COOLANT_HOT", 0x99525E, 1, 0, 0, EnumSymbol.NONE).setTemp(600).setHeatCap(COOLANT.heatCap);
MUG = new FluidType( "MUG", 0x4B2D28, 0, 0, 0, EnumSymbol.NONE).setHeatCap(1D);
MUG_HOT = new FluidType( "MUG_HOT", 0x6B2A20, 0, 0, 0, EnumSymbol.NONE).setHeatCap(MUG.heatCap).setTemp(500);

View File

@ -29,6 +29,7 @@ public class LiquefactionRecipes {
recipes.put(KEY_OIL_TAR, new FluidStack(75, Fluids.BITUMEN));
recipes.put(KEY_CRACK_TAR, new FluidStack(100, Fluids.BITUMEN));
recipes.put(KEY_COAL_TAR, new FluidStack(50, Fluids.BITUMEN));
recipes.put(KEY_LOG, new FluidStack(100, Fluids.MUG));
//general utility recipes because why not
recipes.put(new ComparableStack(Blocks.netherrack), new FluidStack(250, Fluids.LAVA));
recipes.put(new ComparableStack(Blocks.cobblestone), new FluidStack(250, Fluids.LAVA));

View File

@ -3,7 +3,7 @@ package com.hbm.lib;
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4214)";
public static final String VERSION = "1.0.27 BETA (4215)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -109,7 +109,7 @@ public class RBMKDials {
}
/**
* How many heat units are consumed per steam unit (scaled per type) produced.
* How many heat units are consumed per mB water used.
* @param world
* @return >0
*/

View File

@ -57,7 +57,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
steam.setFill(steam.getMaxFill());
}
this.heat -= waterUsed * feed.getTankType().heatCap;
this.heat -= waterUsed * RBMKDials.getBoilerHeatConsumption(worldObj);
}
fillFluidInit(steam.getTankType());

View File

@ -48,12 +48,13 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
if(heatProvided > 0) {
int converted = (int)Math.floor(heatProvided / RBMKDials.getBoilerHeatConsumption(worldObj));
double capacity = feed.getTankType().heatCap;
int converted = (int)Math.floor(heatProvided / capacity);
converted = Math.min(converted, feed.getFill());
converted = Math.min(converted, steam.getMaxFill() - steam.getFill());
feed.setFill(feed.getFill() - converted);
steam.setFill(steam.getFill() + converted);
this.heat -= converted * RBMKDials.getBoilerHeatConsumption(worldObj);
this.heat -= converted * capacity;
}
fillFluidInit(steam.getTankType());

View File

@ -0,0 +1,43 @@
package com.hbm.util;
import com.hbm.inventory.FluidTank;
import com.hbm.inventory.fluid.FluidType;
public class HeatUtil {
/**
* Returns the amount of mB (with decimals!) of the supplied fluid that can be saturated with the given amount of heat
* @param toHeat The type of fluid that should be saturated
* @param heat The amount of heat used
* @return The amount of fluid that can be fully heated
*/
public static double getHeatableAmount(FluidType toHeat, double heat) {
return heat / (toHeat.heatCap * toHeat.temperature);
}
/**
* @param fluid
* @param amount
* @return The total heat energy stored in the given fluid (with a delta from the fluid's temp to 0°C)
*/
public static double getHeatEnergy(FluidType fluid, int amount) {
return fluid.heatCap * fluid.temperature * amount;
}
public static double getAmountAtStandardPressure(FluidType type, int pressurizedAmount) {
return pressurizedAmount * type.compression;
}
public static double getAmountPressurized(FluidType type, int depressurizedAmount) {
return depressurizedAmount / type.compression;
}
//brain mush, will do math later
/*public static double boilTo(FluidTank cold, FluidTank hot, double heat) {
int pressurizedFluid = cold.getFill();
int pressurizedSpace = hot.getMaxFill() - hot.getFill();
//how much heat energy our input tank has
double initialHeat = getHeatEnergy(cold.getTankType(), pressurizedFluid);
}*/
}

View File

@ -3,7 +3,7 @@
"modid": "hbm",
"name": "Hbm's Nuclear Tech",
"description": "A mod that adds weapons, nuclear themed stuff and machines",
"version":"1.0.27_X4214",
"version":"1.0.27_X4215",
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",