A thermodynamic system for blocks
Block Thermo is a thermodynamic system API mod for Minecraft 1.21.1 built on NeoForge. It provides a comprehensive temperature calculation system considering biomes, altitude, time, weather, and radiation sources, offering a powerful temperature API for other mods to use.
This mod features a modular design with extension points that allow other mods to customize various aspects of temperature calculation, including biome temperature, altitude modifiers, time modifiers, weather modifiers, and radiation modifiers.
/blockthermo temperature query
Displays detailed temperature information at your current location, including:
/blockthermo temperature query <x> <y> <z>
Displays temperature information at the specified coordinates.
Mod configuration files are located in the config/block_thermo/ folder in your Minecraft directory.
Contains dimension settings, daily temperature ranges, weather temperature offsets, and radiation settings.
Used to customize base temperatures and altitude change rates for specific biomes.
Used to define radiation intensity for blocks.
import com.drownedcloud.blockthermo.temperature.TemperatureCalculator;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
// Get temperature at current location
float temperature = TemperatureCalculator.getTemperature(level, blockPos);
Block Thermo provides multiple extension points for other mods to customize temperature calculation:
Biome Temperature Provider
ExtensionManager.setBiomeTemperatureProvider(new BiomeTemperatureProvider() {
@Override
public float getBaseTemperature(Biome biome) {
// Custom biome base temperature calculation
return biome.getBaseTemperature() * 30.0f;
}
});
Altitude Temperature Provider
ExtensionManager.setAltitudeTemperatureProvider(new AltitudeTemperatureProvider() {
@Override
public float getAltitudeModifier(float altitudeRate, int y, int seaLevel) {
// Custom altitude modifier calculation
return altitudeRate * (y - seaLevel);
}
});
Time Temperature Provider
ExtensionManager.setTimeTemperatureProvider(new TimeTemperatureProvider() {
@Override
public float getTimeModifier(Level level, float minTemp, float maxTemp) {
// Custom time modifier calculation
long dayTime = level.getDayTime() % 24000;
return minTemp + (maxTemp - minTemp) * (1 - Math.abs(dayTime - 12000) / 12000.0f);
}
});
Weather Temperature Provider
ExtensionManager.setWeatherTemperatureProvider(new WeatherTemperatureProvider() {
@Override
public float getWeatherModifier(Level level, float clear, float rain, float thunder) {
// Custom weather modifier calculation
if (level.isThundering()) return thunder;
if (level.isRaining()) return rain;
return clear;
}
});
Radiation Temperature Provider
ExtensionManager.setRadiationTemperatureProvider(new RadiationTemperatureProvider() {
@Override
public float getRadiationModifier(Level level, BlockPos pos, int maxDistance, String decayType, Map<Block, Float> sources) {
// Custom radiation modifier calculation
return 0.0f;
}
});
If you encounter any issues or have any suggestions while using this mod, please contact us through the following channels:
Code contributions are welcome! Please submit a Pull Request or create an Issue to help improve this mod.