From fc560034508b08acf62c05f1ff8ecf740e182c2c Mon Sep 17 00:00:00 2001 From: Robocraft999 Date: Sat, 7 Oct 2023 14:34:48 +0200 Subject: [PATCH 1/2] generalized getFogDensity - removed explicit check for the netherite diving helmet - added check for netherite armor instead (check for diving helmet is ensured) --- .../com/simibubi/create/foundation/events/ClientEvents.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java b/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java index a7bbd6ac1..7510c512e 100644 --- a/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java @@ -19,6 +19,7 @@ import com.simibubi.create.content.decoration.girder.GirderWrenchBehavior; import com.simibubi.create.content.equipment.armor.BacktankArmorLayer; import com.simibubi.create.content.equipment.armor.DivingHelmetItem; import com.simibubi.create.content.equipment.armor.NetheriteBacktankFirstPersonRenderer; +import com.simibubi.create.content.equipment.armor.NetheriteDivingHandler; import com.simibubi.create.content.equipment.blueprint.BlueprintOverlayRenderer; import com.simibubi.create.content.equipment.clipboard.ClipboardValueSettingsHandler; import com.simibubi.create.content.equipment.extendoGrip.ExtendoGripRenderHandler; @@ -316,7 +317,7 @@ public class ClientEvents { event.scaleFarPlaneDistance(6.25f); event.setCanceled(true); return; - } else if (FluidHelper.isLava(fluid) && AllItems.NETHERITE_DIVING_HELMET.isIn(divingHelmet)) { + } else if (FluidHelper.isLava(fluid) && NetheriteDivingHandler.isNetheriteArmor(divingHelmet)) { event.setNearPlaneDistance(-4.0f); event.setFarPlaneDistance(20.0f); event.setCanceled(true); From 80785351d6c4df8b458a05720593dfbbae4519ad Mon Sep 17 00:00:00 2001 From: Robocraft999 Date: Sat, 7 Oct 2023 12:58:05 +0000 Subject: [PATCH 2/2] generalized checking in NetheriteDivingHandler - allows for using custom diving helmets and backtanks out of netherite --- .../content/equipment/armor/NetheriteDivingHandler.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/equipment/armor/NetheriteDivingHandler.java b/src/main/java/com/simibubi/create/content/equipment/armor/NetheriteDivingHandler.java index 1ab209728..dda758712 100644 --- a/src/main/java/com/simibubi/create/content/equipment/armor/NetheriteDivingHandler.java +++ b/src/main/java/com/simibubi/create/content/equipment/armor/NetheriteDivingHandler.java @@ -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);