package eu.abdelbaki.cmmodular; import net.minecraft.core.registries.Registries; import net.minecraft.tags.FluidTags; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.RangedAttribute; import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.entity.EntityAttributeModificationEvent; import net.neoforged.neoforge.event.entity.living.LivingBreatheEvent; import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredRegister; /** * Sea serpent fang armour lets its wearer breathe underwater, which is what Ice * and Fire's own Tide Guardian armour does and the only reason to hunt the * thing. * *
There is no attribute for it and MIAPI has no property for it either - the * closest data can get is a fake Respiration enchantment, which only postpones * drowning. So this follows the pattern {@link FireImmunity} and * {@link VacuumSeal} already set: an attribute of this mod's own that the * material grants like any other, and a listener here that watches for it. * *
Half a lung per module, as with {@link VacuumSeal}: the fang grants 0.5 in * each armour slot and nothing in hand, so it takes two worn pieces of it - * two sockets, two pieces built of it, or a socketed piece that is both - to * breathe, and a fang weapon breathes not at all. What a fang is worth in hand * is {@link WaterCombat}'s. * *
It answers the same event {@link VacuumSeal} does but only underwater, so
* a fang is a fang and not half a spacesuit.
*/
public final class WaterBreathing {
private static final DeferredRegister