For developers
Heat protection, cooling, and reading or changing heat from another mod.
Maze Escape exposes a small API for heat protection and cooling. Only reference the classes in net.veroxuniverse.maze_escape.api - all other classes may change between versions.
Heat protection
Implement HeatProtectingItem on any item that can be worn in an armour slot.
public class DustMaskItem extends ArmorItem implements HeatProtectingItem {
public DustMaskItem(Holder<ArmorMaterial> material, Type type, Properties properties) {
super(material, type, properties);
}
@Override
public float heatFactor(ItemStack stack) {
return 0.25F;
}
}The factor is the share of heat that still reaches the player: 1.0 means no protection, 0.5 half the heat and 0.0 full immunity. The interface takes priority over the item tags.
Cooling
Implement CoolingItem on any item that is eaten or drunk.
public class IceTeaItem extends Item implements CoolingItem {
public IceTeaItem(Properties properties) {
super(properties);
}
@Override
public int cooling(ItemStack stack) {
return 200;
}
}Reading and changing heat
float heat = ScorchHeat.get(player);
ScorchHeat.set(player, heat - 100.0F);
float factor = ScorchHeat.protectionFactor(player);
int cooling = ScorchHeat.cooling(stack);| Method | Returns |
|---|---|
ScorchHeat.get(Player) | Current heat of the player |
ScorchHeat.set(Player, float) | Sets the heat, clamped between 0 and 720 |
ScorchHeat.itemFactor(ItemStack) | Heat factor of a single item |
ScorchHeat.protectionFactor(LivingEntity) | Best heat factor of all worn armour |
ScorchHeat.cooling(ItemStack) | Cooling value of an item |
ScorchHeat.isWaterBottle(ItemStack) | Whether the item is a water bottle |
The tag keys are available in MazeTags.
