mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-16 06:35:35 +00:00
51 lines
1.4 KiB
Java
51 lines
1.4 KiB
Java
package com.hbm.items.armor;
|
|
|
|
import java.util.List;
|
|
|
|
import com.hbm.extprop.HbmLivingProps;
|
|
import com.hbm.handler.ArmorModHandler;
|
|
import com.hbm.potion.HbmPotion;
|
|
|
|
import com.hbm.util.I18nUtil;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.potion.PotionEffect;
|
|
import net.minecraft.util.EnumChatFormatting;
|
|
|
|
public class ItemModAuto extends ItemArmorMod {
|
|
|
|
public ItemModAuto() {
|
|
super(ArmorModHandler.extra, false, true, false, false);
|
|
}
|
|
|
|
@Override
|
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
|
|
|
list.add(EnumChatFormatting.BLUE + I18nUtil.resolveKey("armorMod.mod.auto"));
|
|
|
|
list.add("");
|
|
super.addInformation(stack, player, list, bool);
|
|
}
|
|
|
|
@Override
|
|
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
|
list.add(EnumChatFormatting.BLUE + " " + stack.getDisplayName());
|
|
}
|
|
|
|
@Override
|
|
public void modUpdate(EntityLivingBase entity, ItemStack armor) {
|
|
|
|
if(!entity.worldObj.isRemote) {
|
|
|
|
if(HbmLivingProps.getDigamma(entity) >= 5F) {
|
|
ArmorModHandler.removeMod(armor, ArmorModHandler.extra);
|
|
entity.worldObj.playSoundAtEntity(entity, "hbm:item.syringe", 1.0F, 1.0F);
|
|
HbmLivingProps.setDigamma(entity, HbmLivingProps.getDigamma(entity) - 5F);
|
|
entity.addPotionEffect(new PotionEffect(HbmPotion.stability.id, 60 * 20, 0));
|
|
entity.heal(20F);
|
|
}
|
|
}
|
|
}
|
|
}
|