diff --git a/src/main/java/com/charles445/simpledifficulty/capability/ThirstCapability.java b/src/main/java/com/charles445/simpledifficulty/capability/ThirstCapability.java index 5c43929..63a9644 100644 --- a/src/main/java/com/charles445/simpledifficulty/capability/ThirstCapability.java +++ b/src/main/java/com/charles445/simpledifficulty/capability/ThirstCapability.java @@ -23,7 +23,7 @@ public class ThirstCapability implements IThirstCapability { private float exhaustion = 0.0f; private int thirst = 20; - private float saturation = 0.0f; + private float saturation = 5.0f; private int ticktimer = 0; private int damagecounter = 0; diff --git a/src/main/java/com/charles445/simpledifficulty/config/ModConfig.java b/src/main/java/com/charles445/simpledifficulty/config/ModConfig.java index f4d96bf..f3354e1 100644 --- a/src/main/java/com/charles445/simpledifficulty/config/ModConfig.java +++ b/src/main/java/com/charles445/simpledifficulty/config/ModConfig.java @@ -153,6 +153,11 @@ public class ConfigMiscellaneous @Config.RangeInt(min=1) public int rainCollectorFillChance = 6; + @Config.Comment("Whether to register the cooling and heating enchantments") + @Config.Name("RegisterEnchantments") + @Config.RequiresMcRestart + public boolean registerEnchantments = true; + @Config.Comment("Duration of short heat/cold resistance potions, in ticks") @Config.Name("ResistancePotionDurationShort") @Config.RequiresMcRestart diff --git a/src/main/java/com/charles445/simpledifficulty/register/RegisterEnchantments.java b/src/main/java/com/charles445/simpledifficulty/register/RegisterEnchantments.java index 305491f..d1254fb 100644 --- a/src/main/java/com/charles445/simpledifficulty/register/RegisterEnchantments.java +++ b/src/main/java/com/charles445/simpledifficulty/register/RegisterEnchantments.java @@ -3,6 +3,7 @@ import static com.charles445.simpledifficulty.api.SDEnchantments.*; import com.charles445.simpledifficulty.SimpleDifficulty; +import com.charles445.simpledifficulty.config.ModConfig; import com.charles445.simpledifficulty.enchantment.EnchantmentArmorTemperature; import net.minecraft.enchantment.Enchantment; @@ -30,7 +31,9 @@ private static Enchantment registerAs(String name, final Enchantment newEnchantm { newEnchantment.setName(name); newEnchantment.setRegistryName(SimpleDifficulty.MODID,name); - registry.register(newEnchantment); + + if(ModConfig.server.miscellaneous.registerEnchantments) + registry.register(newEnchantment); //Add to map enchantments.put(name, newEnchantment); diff --git a/src/main/java/com/charles445/simpledifficulty/temperature/ModifierArmor.java b/src/main/java/com/charles445/simpledifficulty/temperature/ModifierArmor.java index e96033f..7cd9234 100644 --- a/src/main/java/com/charles445/simpledifficulty/temperature/ModifierArmor.java +++ b/src/main/java/com/charles445/simpledifficulty/temperature/ModifierArmor.java @@ -41,13 +41,16 @@ private float checkArmorSlot(ItemStack stack) float sum = 0.0f; //Enchantments - if(EnchantmentHelper.getEnchantmentLevel(SDEnchantments.chilling, stack) > 0) + if(ModConfig.server.miscellaneous.registerEnchantments) { - sum -= ModConfig.server.temperature.enchantmentTemperature; - } - else if(EnchantmentHelper.getEnchantmentLevel(SDEnchantments.heating, stack) > 0) - { - sum += ModConfig.server.temperature.enchantmentTemperature; + if(EnchantmentHelper.getEnchantmentLevel(SDEnchantments.chilling, stack) > 0) + { + sum -= ModConfig.server.temperature.enchantmentTemperature; + } + else if(EnchantmentHelper.getEnchantmentLevel(SDEnchantments.heating, stack) > 0) + { + sum += ModConfig.server.temperature.enchantmentTemperature; + } } //Process JSON