add vanity enchantment
This commit is contained in:
parent
fb6b612934
commit
2d34d139c5
3 changed files with 20 additions and 2 deletions
|
@ -7,6 +7,8 @@ import client.renderer.GlState;
|
|||
import client.renderer.entity.RendererLivingEntity;
|
||||
import client.renderer.model.ModelArmor;
|
||||
import client.renderer.model.ModelBiped;
|
||||
import common.enchantment.Enchantment;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.types.EntityLiving;
|
||||
import common.item.ItemStack;
|
||||
import common.item.material.ItemArmor;
|
||||
|
@ -50,9 +52,8 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
|
|||
{
|
||||
ItemStack itemstack = this.getCurrentArmor(entitylivingbaseIn, armorSlot);
|
||||
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemArmor)
|
||||
if (itemstack != null && itemstack.getItem() instanceof ItemArmor itemarmor && (this.renderer == null || EnchantmentHelper.getEnchantmentLevel(Enchantment.VANITY, itemstack) <= 0))
|
||||
{
|
||||
ItemArmor itemarmor = (ItemArmor)itemstack.getItem();
|
||||
ModelArmor t = this.getArmorModel(armorSlot);
|
||||
t.setModelAttributes(this.renderer != null ? this.renderer.getMainModel() : null);
|
||||
t.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partial);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue