Updated @RebornRegister annotation usage

This commit is contained in:
drcrazy 2019-02-21 12:48:35 +03:00
parent 860068b27a
commit 5c7c29f34d
55 changed files with 59 additions and 60 deletions

View file

@ -50,7 +50,7 @@ import techreborn.init.TRContent;
import javax.annotation.Nullable;
@RebornRegister(modID = TechReborn.MOD_ID)
@RebornRegister(TechReborn.MOD_ID)
public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo {
public static int maxCharge = ConfigTechReborn.CloakingDeviceCharge;
@ -76,14 +76,14 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo
public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
if (entityIn instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entityIn;
IEnergyStorage capEnergy = new ForgePowerItemManager(stack);
if (capEnergy != null && capEnergy.getEnergyStored() >= usage) {
capEnergy.extractEnergy(usage, false);
// TODO: Optimize
((EntityPlayer) entityIn).setInvisible(true);
player.setInvisible(true);
} else {
if (!((EntityPlayer) entityIn).isPotionActive(MobEffects.INVISIBILITY)) {
((EntityPlayer) entityIn).setInvisible(false);
if (!player.isPotionActive(MobEffects.INVISIBILITY)) {
player.setInvisible(false);
}
}
}