From de202d131bc9cdbbab46dbba2602edf073e770e1 Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 18 Feb 2019 20:19:55 +0200 Subject: [PATCH] Added an armour texture for the amulet --- .../unicopia/item/ItemAlicornAmulet.java | 13 ++++++++++--- .../textures/models/armor/alicorn_amulet.png | Bin 0 -> 550 bytes 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/assets/unicopia/textures/models/armor/alicorn_amulet.png diff --git a/src/main/java/com/minelittlepony/unicopia/item/ItemAlicornAmulet.java b/src/main/java/com/minelittlepony/unicopia/item/ItemAlicornAmulet.java index bc382522..49b01a54 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/ItemAlicornAmulet.java +++ b/src/main/java/com/minelittlepony/unicopia/item/ItemAlicornAmulet.java @@ -16,6 +16,7 @@ import com.minelittlepony.util.vector.VecHelper; import net.minecraft.client.resources.I18n; import net.minecraft.client.util.ITooltipFlag; +import net.minecraft.entity.Entity; import net.minecraft.entity.MoverType; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -152,15 +153,16 @@ public class ItemAlicornAmulet extends ItemArmor implements IDependable { IPlayer iplayer = PlayerSpeciesList.instance().getPlayer(player); + float attachedTime = iplayer.getInventory().getTicksAttached(this); + if (iplayer.getExertion() < 1) { iplayer.addExertion(2); } - if (iplayer.getEnergy() < 0.005F) { + + if (iplayer.getEnergy() < 0.005F + (attachedTime / 1000000)) { iplayer.addEnergy(2); } - int attachedTime = iplayer.getInventory().getTicksAttached(this); - if (attachedTime == 1) { world.playSound(null, player.getPosition(), SoundEvents.ENTITY_ELDER_GUARDIAN_CURSE, SoundCategory.PLAYERS, 3, 1); } @@ -218,6 +220,11 @@ public class ItemAlicornAmulet extends ItemArmor implements IDependable { } } + @Override + public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { + return "unicopia:textures/models/armor/alicorn_amulet.png"; + } + @Override public Multimap getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) { Multimap multimap = HashMultimap.create();; diff --git a/src/main/resources/assets/unicopia/textures/models/armor/alicorn_amulet.png b/src/main/resources/assets/unicopia/textures/models/armor/alicorn_amulet.png new file mode 100644 index 0000000000000000000000000000000000000000..d79eb54845207b84638f32747658c4ef05ca9c6c GIT binary patch literal 550 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!3HERU8}EWU|@Xf>EaktaqI1M`|PMdiQ^yF zZ+&^qaovQL1-Sy#S(YRyPH+%YWU)F?D|~e0`-RTd+q~QS@?>lI6-8R&W*v2CTd;Fs z?=ybMO&+pup1AtlQYu;T?Dx!fqVhXFRG%w8$LKjp1qWJEpRzeduFt-If40@i$h@Yb zHF6DcGRz-TyMo-T=DPp?&EA$+@&1)u>;HeBCdDi?2wj`Df|0?mysT~V>i;JXG39^z z{xd>LFlBT7+KW8q4(eT#91a`EJmX?*%9*y;>*;ph%biM>=T2w)v0?9AmfPLQb$o0x zX0ust>Rb;GFF&+Dck3jnzc(L8{=DEP@^Mehvtoe{Yc6`UCR*6!m@!&dTPlWY6iBf+ zH@vR9pYlAF$waF6NlN|gEY1H{XBP67@Q&6yM+X;^@ZJ_4D!=A1m(_KR##veC7{j+1w4y zQN2MMITC(+wqaCLKX`iU)+gKZk01Y&v7Pt7qRD|LWd((Wi9h%s3Rvuv%{gQ+*H3yM eJO)bU$DeB3>Arn#N+>Y?89ZJ6T-G@yGywoK@BNto literal 0 HcmV?d00001