Merge pull request #5606 from Robocraft999/patch-1

generalized getFogDensity and checking for armor in NetheriteDivingHandler
This commit is contained in:
simibubi 2023-10-22 12:11:59 +02:00 committed by GitHub
commit 0d6d4b7ee5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

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);

View file

@ -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);