
WaterBar999
The WaterBar plugin enhances Minecraft gameplay by implementing a thirst management system that requires players to monitor their hydration levels, collect and purify water, and adapt their survival strategies based on biome conditions.
Список изменений
Configuration Changes Added Configuration Options: Introduced a new configuration structure in config.yml for water system settings: water-levels: max-water: Maximum water level (default: 100) starting-water: Starting water level for players (default: 100) warning-threshold: Water level threshold for warnings (default: 20) dirty-water-restore: Water restored from drinking dirty water (default: 5) clean-water-restore: Water restored from drinking clean water (default: 20) water-loss: hot-loss: Water loss rate in hot biomes (default: 0.66) cold-loss: Water loss rate in cold biomes (default: 0.16) default-loss: Default water loss rate (default: 0.33) hot-biomes: List of hot biomes (e.g., "DESERT", "SAVANNA", "BADLANDS") cold-biomes: List of cold biomes (e.g., "SNOWY_PLAINS", "ICE_SPIKES", "FROZEN_OCEAN") effects: dirty-water: poison-duration: Duration of poison effect from dirty water (default: 100) poison-strength: Strength of poison effect from dirty water (default: 0) Code Changes Biome Loss Rate Loading:
Added loadBiomeLossRates() method to load biome-specific water loss rates from the configuration. Player Data Management:
Added loadPlayerData(UUID uuid) method to load player data from player.yml. Implemented automatic creation of player data entries if they do not exist, initializing water levels to the starting value from the configuration. Introduced getPlayerConfig() and savePlayerConfig(FileConfiguration playerConfig) methods to handle player data storage in player.yml. Water Level Updates:
Updated the logic in onPlayerDrink(PlayerItemConsumeEvent event) to use configurable values for restoring water levels when consuming dirty or clean water. Dynamic Water Loss:
Updated the updatePlayerThirst(Player player) method to use the loaded biome loss rates, including a default loss rate for unspecified biomes. Removed Hardcoded Values:
Replaced hardcoded values for maximum water, starting water, and restoration amounts with values loaded from the configuration. Updated Player Join Logic:
Modified onPlayerJoin(PlayerJoinEvent event) to load player data upon joining, ensuring that player water levels are initialized correctly. Removed Unused Code:
Removed any code that was not necessary for the new configuration and functionality.
