From 4c2c69f84ef3540dc5bcfd0b5f1787e3d3d5daf1 Mon Sep 17 00:00:00 2001 From: gigabit101 Date: Tue, 4 Aug 2015 21:12:27 +0100 Subject: [PATCH] Added cloaking device {WIP} --- src/main/java/techreborn/init/ModItems.java | 5 ++ src/main/java/techreborn/items/ItemTR.java | 4 +- .../items/tools/ItemCloakingDevice.java | 61 +++++++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 src/main/java/techreborn/items/tools/ItemCloakingDevice.java diff --git a/src/main/java/techreborn/init/ModItems.java b/src/main/java/techreborn/init/ModItems.java index 5978d10bc..1ffd2f01f 100644 --- a/src/main/java/techreborn/init/ModItems.java +++ b/src/main/java/techreborn/init/ModItems.java @@ -14,6 +14,7 @@ import techreborn.items.*; import techreborn.items.armor.ItemLapotronPack; import techreborn.items.armor.ItemLithiumBatpack; import techreborn.items.tools.ItemAdvancedDrill; +import techreborn.items.tools.ItemCloakingDevice; import techreborn.items.tools.ItemFluidbucket; import techreborn.items.tools.ItemHammer; import techreborn.items.tools.ItemOmniTool; @@ -44,6 +45,7 @@ public class ModItems { public static Item rods; public static Item crushedOre; public static Item purifiedCrushedOre; + public static Item cloakingDevice; public static Item bucketBerylium; public static Item bucketcalcium; @@ -131,6 +133,9 @@ public class ModItems { farmPatten = new ItemFarmPatten(); GameRegistry.registerItem(farmPatten, "farmPatten"); + + cloakingDevice = new ItemCloakingDevice(); + GameRegistry.registerItem(cloakingDevice, "cloakingdevice"); // buckets bucketBerylium = new ItemFluidbucket(ModFluids.BlockFluidBerylium); diff --git a/src/main/java/techreborn/items/ItemTR.java b/src/main/java/techreborn/items/ItemTR.java index a4f6dd4ea..00ef94cc8 100644 --- a/src/main/java/techreborn/items/ItemTR.java +++ b/src/main/java/techreborn/items/ItemTR.java @@ -16,8 +16,6 @@ public class ItemTR extends Item { @Override public void registerIcons(IIconRegister iconRegister) { - itemIcon = iconRegister.registerIcon(ModInfo.MOD_ID + ":" - + getUnlocalizedName().toLowerCase().substring(5)); + itemIcon = iconRegister.registerIcon(ModInfo.MOD_ID + ":" + getUnlocalizedName().toLowerCase().substring(5)); } - } diff --git a/src/main/java/techreborn/items/tools/ItemCloakingDevice.java b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java new file mode 100644 index 000000000..86f83de27 --- /dev/null +++ b/src/main/java/techreborn/items/tools/ItemCloakingDevice.java @@ -0,0 +1,61 @@ +package techreborn.items.tools; + +import ic2.api.item.ElectricItem; +import ic2.api.item.IElectricItem; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.world.World; +import techreborn.items.ItemTR; + +public class ItemCloakingDevice extends ItemTR implements IElectricItem +{ + public static int Teir = 3; + public static int MaxCharge = 100000; + public static int Limit = 100; + public static boolean isActive; + + public ItemCloakingDevice() + { + setUnlocalizedName("techreborn.cloakingdevice"); + } + + @Override + public boolean canProvideEnergy(ItemStack itemStack) + { + return false; + } + + @Override + public Item getChargedItem(ItemStack itemStack) + { + return this; + } + + @Override + public Item getEmptyItem(ItemStack itemStack) + { + return this; + } + + @Override + public double getMaxCharge(ItemStack itemStack) + { + return MaxCharge; + } + + @Override + public int getTier(ItemStack itemStack) + { + return Teir; + } + + @Override + public double getTransferLimit(ItemStack itemStack) + { + return Limit; + } +}