Skip to content

Commit

Permalink
Fixed Fabric crashing with leaf armor. Closes #847
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Jun 8, 2024
1 parent ed18ef0 commit 22ee2bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/src/main/java/toughasnails/item/LeafArmorItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public LeafArmorItem(Holder<ArmorMaterial> $$0, Type $$1, Properties $$2) {
@Override
public void inventoryTick(ItemStack stack, Level level, Entity entity, int p_41407_, boolean p_41408_)
{
if (!level.isClientSide())
return;

if (stack.getItem() == TANItems.LEAF_BOOTS || stack.getItem() == TANItems.LEAF_LEGGINGS || stack.getItem() == TANItems.LEAF_CHESTPLATE || stack.getItem() == TANItems.LEAF_HELMET)
stack.set(DataComponents.DYED_COLOR, new DyedItemColor(BiomeColors.getAverageFoliageColor(entity.level(), entity.blockPosition()), false));
}
Expand Down

0 comments on commit 22ee2bb

Please sign in to comment.