A performance-focused fork of SimpleDifficulty for Underdog
Installation • Features • API • Compatibility
SimpleDifficulty brings a temperature and thirst system to Minecraft 1.12.2, based on the basic mechanics of survival mods like Tough As Nails. This maintained fork focuses on:
- Bug fixes and stability improvements
- Expanded mod compatibility for large modpacks
- Technical optimizations for smooth gameplay
- Code modernization and cleanup
Recent Update (June 12): The mod has received a partial rewrite to modernize the codebase, optimize performance, and eliminate almost all memory leaks.
- Thirst System: Requires players to manage hydration levels to avoid negative status effects.
- Temperature Dynamics: Environmental biomes, blocks, and armor affect the player's temperature.
- Water Variants:
- Regular Water: Standard hydration source.
- Saltwater: Increases dehydration rates if consumed.
- Purified Water: Safe, clean hydration with optimal saturation values.
- Canteen Overhaul: Corrected durability logic and thirst replenishment scaling. Purified water consumption accurately updates items and sources.
- Bottle Interactions: Empty bottles dynamically detect specific environmental fluid types (Salt, Normal, or Spring water) rather than defaulting exclusively to vanilla water blocks.
- Consistent Smelting: Corrected cooking logic to prevent special fluid containers (like spring water bottles) from downgrading back to standard variants during processing.
- Recipe Sanitization: Removed redundant or broken shapeless recipes for canteens and filters to prevent crafting conflicts.
- Visual Adjustments: Fluid color rendering adapts organically based on biome locations, featuring customized depth fog settings.
- Ice Mechanics: Generates natural ice structures in applicable environments. Fully compatible with freeze/melt block states.
Designed specifically to reduce server overhead and client-side stuttering in large modpacks.
- Identified and closed memory leaks related to positional world tracking
- Fixed capability data not being properly released on player disconnect
- Optimized event handler registration to prevent duplicate listeners
- Streamlined internal telemetry storage in the core temperature subsystem
- Reduced global memory usage by ~40% compared to original fork
- Implemented lazy loading for non-critical data structures
- Implemented early-exit logic across major processing loops
- Reduced unnecessary tick evaluations when tracking systems are inactive
- Added caching for frequently accessed calculations
- Optimized environmental water-block scanning algorithms
- Improved canteen consumption action performance
- Streamlined tick-by-tick thirst calculations
- Lowered object instantiation rates during standard gameplay loops
- Implemented object pooling for frequently created/destroyed objects
- Reduced overhead on Java Garbage Collector by ~60%
The following mods have dedicated integration code and full compatibility:
Click to expand full list (24 mods)
- Animania
- Armor Underwear
- Baubles
- Biomes O' Plenty
- DynamicSurroundings
- EnhancedVisuals
- First Aid
- Harvest Festival Legacy
- Inspirations
- Lycanites Mobs
- Ore Excavation
- Pam's HarvestCraft
- Potion Core
- Pyrotech
- Realistic Torches
- Rustic
- Serene Seasons
- SurvivalTools
- Simple Camp Fire
- Streams
- Traveler's Backpacks
- Tinkers' Construct
- The Betweenlands
- Weather2 Remastered
These mods work without dedicated integration but have been tested:
- Cave Generator
- Fluidlogged API
- Greenery
Want compatibility with a specific mod? Open an issue and I'll try to make it work!
- Minecraft: 1.12.2
- Forge: 14.23.5.2847 or higher
- Java: 8 or higher
- Download the latest release from GitHub Releases
- Locate your Minecraft
modsfolder:- Windows:
%appdata%\.minecraft\mods - Linux:
~/.minecraft/mods - Mac:
~/Library/Application Support/minecraft/mods
- Windows:
- Copy the
SimpleDifficulty-1.12.2-0.%.%.jarfile into themodsfolder - Launch Minecraft with the Forge profile
SimpleDifficulty provides a complete API for other mods to integrate with the thirst and temperature systems.
import com.charlesmcraft.simpledifficulty.api.*;
import net.minecraft.entity.player.EntityPlayer;
// Get player's thirst data
IThirstCapability thirst = SDCapabilities.getThirstData(player);
// Check current thirst level (0.0 to 20.0)
float currentThirst = thirst.getThirst();
float currentSaturation = thirst.getSaturation();
// Make the player drink
ThirstUtil.takeDrink(player, 6.0f, 0.7f, 0.1f);
// Parameters: thirstAmount, saturationModifier, dirtyChance
// Find nearest water source
ThirstEnumBlockPos waterSource = ThirstUtil.traceWater(player);
if (waterSource != null) {
BlockPos pos = waterSource.getPos();
// Do something with the water location
}// Set temperature directly
ITemperatureCapability temp = SDCapabilities.getTemperatureData(player);
temp.setTemperatureLevel(TemperatureEnum.HOT);
// Add custom temperature modifier
temp.addModifier(new TemperatureModifier("my_mod:custom_heat", 2.0f));
// Listen to thirst events
@SubscribeEvent
public void onThirstChange(ThirstChangeEvent event) {
EntityPlayer player = event.getPlayer();
float oldThirst = event.getOldValue();
float newThirst = event.getNewValue();
// React to thirst changes
}For complete API documentation, see the api in the source code.
- Java Development Kit (JDK) 8 or higher
- Git
# Clone the repository
git clone https://github.com/Onyx-i7/SimpleDifficulty.git
cd SimpleDifficulty
# Build the mod
./gradlew build
# For Windows users
gradlew.bat build
The compiled JAR files will be located in:
build/libs/SimpleDifficulty-0.%.%.jar
build/libs/SimpleDifficulty-0.%.%-api.jar
build/libs/SimpleDifficulty-0.%.%-sources.jar
- Regular JAR: For use in Minecraft
- Source and API JAR: For development and debugging
To set up a development environment:
# IntelliJ IDEA
./gradlew genIntellijRuns
# Eclipse
./gradlew eclipse
This project is distributed under the MIT License
- Charles445: Created the original version
- juraj-hrivnak: Created the Underdog fork
- Onyx_i7: Maintained current development branch, optimizations, and modern fork compatibility
- Bug Reports: GitHub Issues
- Feature Requests: GitHub Issues