Invisibility Cloak

This commit is contained in:
Vasco Lavos committed 2016-10-22 12:13:58 +01:00
1 parent 82435d43b7
commit e7499424d6
10 files changed
+141 -2

No files matched your search

@@ -54,7 +54,7 @@ public class ModBrews {
resistance = new BrewMod(LibBrewNames.RESISTANCE, 0xB44E17, 4000, new PotionEffect(MobEffects.RESISTANCE, 1800, 1));
fireResistance = new BrewMod(LibBrewNames.FIRE_RESISTANCE, 0xF86900, 4000, new PotionEffect(MobEffects.FIRE_RESISTANCE, 9600, 0));
waterBreathing = new BrewMod(LibBrewNames.WATER_BREATHING, 0x84A7CF, 4000, new PotionEffect(MobEffects.WATER_BREATHING, 9600, 0));
invisibility = new BrewMod(LibBrewNames.INVISIBILITY, 0xAEAEAE, 8000, new PotionEffect(MobEffects.INVISIBILITY, 9600, 0));
invisibility = new BrewMod(LibBrewNames.INVISIBILITY, 0xAEAEAE, 8000, new PotionEffect(MobEffects.INVISIBILITY, 9600, 0)).setNotBloodPendantInfusable();
nightVision = new BrewMod(LibBrewNames.NIGHT_VISION, 0x7C4BEB, 4000, new PotionEffect(MobEffects.NIGHT_VISION, 9600, 0));
absorption = new BrewMod(LibBrewNames.ABSORPTION, 0xF2EB23, 7000, new PotionEffect(MobEffects.ABSORPTION, 1800, 3)).setNotBloodPendantInfusable().setNotIncenseInfusable();
@@ -249,6 +249,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.icePendant);
addItem(ModItems.lavaPendant);
addItem(ModItems.superLavaPendant);
addItem(ModItems.invisibilityCloak);
addItem(ModItems.holyCloak);
addItem(ModItems.unholyCloak);
addItem(ModItems.balanceCloak);
@@ -48,6 +48,7 @@ import vazkii.botania.common.item.equipment.bauble.ItemGreaterMagnetRing;
import vazkii.botania.common.item.equipment.bauble.ItemGreaterManaRing;
import vazkii.botania.common.item.equipment.bauble.ItemHolyCloak;
import vazkii.botania.common.item.equipment.bauble.ItemIcePendant;
import vazkii.botania.common.item.equipment.bauble.ItemInvisibilityCloak;
import vazkii.botania.common.item.equipment.bauble.ItemItemFinder;
import vazkii.botania.common.item.equipment.bauble.ItemKnockbackBelt;
import vazkii.botania.common.item.equipment.bauble.ItemLavaPendant;
@@ -269,6 +270,7 @@ public final class ModItems {
public static Item speedUpBelt;
public static Item baubleBox;
public static Item dodgeRing;
public static Item invisibilityCloak;
public static void init() {
lexicon = new ItemLexicon();
@@ -418,7 +420,8 @@ public final class ModItems {
speedUpBelt = new ItemSpeedUpBelt();
baubleBox = new ItemBaubleBox();
dodgeRing = new ItemDodgeRing();
invisibilityCloak = new ItemInvisibilityCloak();
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(int i = 0; i < 16; i++) {
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
@@ -0,0 +1,59 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [22/10/2016, 11:51:06 (GMT)]
*/
package vazkii.botania.common.item.equipment.bauble;
import baubles.api.BaubleType;
import baubles.api.BaublesApi;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import vazkii.botania.api.mana.IManaUsingItem;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.common.lib.LibItemNames;
public class ItemInvisibilityCloak extends ItemBauble implements IManaUsingItem {
public ItemInvisibilityCloak() {
super(LibItemNames.INVISIBILITY_CLOAK);
}
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.BODY;
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
PotionEffect effect = player.getActivePotionEffect(MobEffects.INVISIBILITY);
if(effect != null && player instanceof EntityPlayer && effect.getAmplifier() == -42 && ManaItemHandler.requestManaExact(stack, (EntityPlayer) player, 2, true))
player.removePotionEffect(MobEffects.INVISIBILITY);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
PotionEffect effect = player.getActivePotionEffect(MobEffects.NIGHT_VISION);
if(effect == null) {
PotionEffect neweffect = new PotionEffect(MobEffects.INVISIBILITY, Integer.MAX_VALUE, -42, true, true);
player.addPotionEffect(neweffect);
}
}
@Override
public boolean usesMana(ItemStack stack) {
return true;
}
}
@@ -161,6 +161,7 @@ public final class LibItemNames {
public static final String SPEED_UP_BELT = "speedUpBelt";
public static final String BAUBLE_BOX = "baubleBox";
public static final String DODGE_RING = "dodgeRing";
public static final String INVISIBILITY_CLOAK = "invisibilityCloak";
public static final String[] LENS_NAMES = new String[] {
"lensNormal",