generalized checking in NetheriteDivingHandler

- allows for using custom diving helmets and backtanks out of netherite
This commit is contained in:
Robocraft999 2023-10-07 12:58:05 +00:00
parent fc56003450
commit 80785351d6

View file

@ -1,7 +1,5 @@
package com.simibubi.create.content.equipment.armor;
import com.simibubi.create.AllItems;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
@ -28,13 +26,13 @@ public final class NetheriteDivingHandler {
ItemStack to = event.getTo();
if (slot == EquipmentSlot.HEAD) {
if (AllItems.NETHERITE_DIVING_HELMET.isIn(to)) {
if (to.getItem() instanceof DivingHelmetItem && isNetheriteArmor(to)) {
setBit(entity, slot);
} else {
clearBit(entity, slot);
}
} else if (slot == EquipmentSlot.CHEST) {
if (AllItems.NETHERITE_BACKTANK.isIn(to) && BacktankUtil.hasAirRemaining(to)) {
if (to.getItem() instanceof BacktankItem && isNetheriteArmor(to) && BacktankUtil.hasAirRemaining(to)) {
setBit(entity, slot);
} else {
clearBit(entity, slot);