Merge pull request #6464 from Attack8/mc1.18/othernetherite

Allow any fire resistant armor to be used in lava diving
This commit is contained in:
simibubi 2024-07-17 11:03:15 +02:00 committed by GitHub
commit 856c1644a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,7 @@ import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ArmorItem; import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ArmorMaterials; import net.minecraft.world.item.ArmorMaterials;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.Tags;
import net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent; import net.minecraftforge.event.entity.living.LivingEquipmentChangeEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@ -51,13 +52,13 @@ public final class NetheriteDivingHandler {
public static boolean isNetheriteDivingHelmet(ItemStack stack) { public static boolean isNetheriteDivingHelmet(ItemStack stack) {
return stack.getItem() instanceof DivingHelmetItem && isNetheriteArmor(stack); return stack.getItem() instanceof DivingHelmetItem && isNetheriteArmor(stack);
} }
public static boolean isNetheriteBacktank(ItemStack stack) { public static boolean isNetheriteBacktank(ItemStack stack) {
return stack.is(AllItemTags.PRESSURIZED_AIR_SOURCES.tag) && isNetheriteArmor(stack); return stack.is(AllItemTags.PRESSURIZED_AIR_SOURCES.tag) && isNetheriteArmor(stack);
} }
public static boolean isNetheriteArmor(ItemStack stack) { public static boolean isNetheriteArmor(ItemStack stack) {
return stack.getItem() instanceof ArmorItem armorItem && armorItem.getMaterial() == ArmorMaterials.NETHERITE; return stack.getItem() instanceof ArmorItem armorItem && armorItem.isFireResistant();
} }
public static void setBit(LivingEntity entity, EquipmentSlot slot) { public static void setBit(LivingEntity entity, EquipmentSlot slot) {