Skip to content

Commit

Permalink
conditional armor stat fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rosevcook committed May 18, 2024
1 parent 6ae634a commit ac68eb0
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import com.rosemods.windswept.common.item.SnowBootsItem;
import com.rosemods.windswept.core.other.tags.WindsweptEntityTypeTags;
import com.rosemods.windswept.core.registry.WindsweptEffects;
import com.rosemods.windswept.core.registry.WindsweptItems;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.EntityTypeTags;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
Expand Down Expand Up @@ -60,10 +62,10 @@ private void onChangedBlock(BlockPos pos, CallbackInfo info) {

if (SnowBootsItem.canApplySnowSpeed(entity))
SnowBootsItem.tryAddSnowSpeed(entity);
else if (!entity.level.getBlockState(entity.getOnPos()).isAir() || entity.isFallFlying())
else if (!entity.level.getBlockState(entity.getOnPos()).isAir() || entity.isFallFlying() || !entity.getItemBySlot(EquipmentSlot.FEET).is(WindsweptItems.SNOW_BOOTS.get()))
SnowBootsItem.removeSnowSpeed(entity);

if (!entity.isSprinting())
if (!entity.isSprinting() || !entity.getItemBySlot(EquipmentSlot.HEAD).is(WindsweptItems.ANTLER_HELMET.get()))
AntlerHelmetItem.removeSprintDamage(entity);

AntlerHelmetItem.tryAddSprintDamage(entity);
Expand Down

0 comments on commit ac68eb0

Please sign in to comment.