Skip to content

Commit

Permalink
Merge pull request #1969 from mystchonky/generalise-armor
Browse files Browse the repository at this point in the history
Make Curio and Elytra-render Item checks generalized
  • Loading branch information
WayofTime committed Sep 5, 2023
2 parents 26ebaf3 + 05fa3f6 commit 2f166e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.item.ItemStack;
import wayoftime.bloodmagic.common.item.ItemLivingArmor;
import wayoftime.bloodmagic.core.LivingArmorRegistrar;
import wayoftime.bloodmagic.core.living.ILivingContainer;
import wayoftime.bloodmagic.core.living.LivingStats;
import wayoftime.bloodmagic.core.living.LivingUtil;

Expand All @@ -25,7 +26,7 @@ public BloodElytraLayer(RenderLayerParent<T, M> p_174493_, EntityModelSet p_1744
@Override
public boolean shouldRender(ItemStack stack, T entity)
{
if (stack.getItem() instanceof ItemLivingArmor && entity instanceof Player && LivingUtil.hasFullSet((Player) entity))
if (stack.getItem() instanceof ILivingContainer && entity instanceof Player && LivingUtil.hasFullSet((Player) entity))
return LivingStats.fromPlayer((Player) entity, true).getLevel(LivingArmorRegistrar.UPGRADE_ELYTRA.get().getKey()) > 0;
return false;
}
Expand Down
Expand Up @@ -40,6 +40,7 @@
import wayoftime.bloodmagic.core.LivingArmorRegistrar;
import wayoftime.bloodmagic.core.data.Binding;
import wayoftime.bloodmagic.core.data.SoulNetwork;
import wayoftime.bloodmagic.core.living.ILivingContainer;
import wayoftime.bloodmagic.core.living.LivingStats;
import wayoftime.bloodmagic.core.living.LivingUtil;
import wayoftime.bloodmagic.demonaura.WorldDemonWillHandler;
Expand Down Expand Up @@ -1143,7 +1144,7 @@ public void onLivingEquipmentChange(LivingEquipmentChangeEvent event)
{
if (BloodMagic.curiosLoaded)
{ // Without Curios, there is nothing this cares about.
if (event.getFrom().getItem() instanceof ItemLivingArmor || event.getTo().getItem() instanceof ItemLivingArmor)
if (event.getFrom().getItem() instanceof ILivingContainer || event.getTo().getItem() instanceof ILivingContainer)
{ // Armor change involves Living Armor
LivingEntity entity = event.getEntity();
if (entity instanceof Player)
Expand Down

0 comments on commit 2f166e1

Please sign in to comment.