diff --git a/src/main/scala/resonantinduction/atomic/Atomic.scala b/src/main/scala/resonantinduction/atomic/Atomic.scala index 41cad9889..154bfd7db 100644 --- a/src/main/scala/resonantinduction/atomic/Atomic.scala +++ b/src/main/scala/resonantinduction/atomic/Atomic.scala @@ -14,7 +14,7 @@ import net.minecraft.block.Block import net.minecraft.block.material.Material import net.minecraft.creativetab.CreativeTabs import net.minecraft.init.Items -import net.minecraft.item.{Item, ItemBucket, ItemStack} +import net.minecraft.item.{ItemBucket, ItemStack} import net.minecraft.tileentity.TileEntity import net.minecraft.util.MovingObjectPosition import net.minecraft.world.World @@ -178,15 +178,15 @@ object Atomic AtomicContent.itemHazmatBody = new ItemHazmat("HazmatBody", 1).setCreativeTab(ResonantTab) AtomicContent.itemHazmatLeggings = new ItemHazmat("HazmatLeggings", 2).setCreativeTab(ResonantTab) AtomicContent.itemHazmatBoots = new ItemHazmat("HazmatBoots", 3).setCreativeTab(ResonantTab) - AtomicContent.itemCell = new Item().setUnlocalizedName("cellEmpty").setCreativeTab(ResonantTab) - AtomicContent.itemFissileFuel = new ItemFissileFuel().setUnlocalizedName("rodFissileFuel").setCreativeTab(ResonantTab) - AtomicContent.itemDeuteriumCell = new ItemCell().setUnlocalizedName("cellDeuterium").setCreativeTab(ResonantTab) - AtomicContent.itemTritiumCell = new ItemCell().setUnlocalizedName("cellTritium").setCreativeTab(ResonantTab) - AtomicContent.itemWaterCell = new ItemCell().setUnlocalizedName("cellWater").setCreativeTab(ResonantTab) - AtomicContent.itemDarkMatter = new ItemDarkMatter().setUnlocalizedName("darkMatter").setCreativeTab(ResonantTab) - AtomicContent.itemAntimatter = new ItemAntimatter().setUnlocalizedName("antimatter").setCreativeTab(ResonantTab) - AtomicContent.itemBreedingRod = new ItemBreederFuel().setUnlocalizedName("rodBreederFuel").setCreativeTab(ResonantTab) - AtomicContent.itemYellowCake = new ItemRadioactive().setUnlocalizedName("yellowcake").setCreativeTab(ResonantTab) + AtomicContent.itemCell = new ItemCell("cellEmpty") + AtomicContent.itemFissileFuel = new ItemFissileFuel() + AtomicContent.itemDeuteriumCell = new ItemCell("cellDeuterium") + AtomicContent.itemTritiumCell = new ItemCell("cellTritium") + AtomicContent.itemWaterCell = new ItemCell("cellWater") + AtomicContent.itemDarkMatter = new ItemCell("darkMatter") + AtomicContent.itemAntimatter = new ItemAntimatter() + AtomicContent.itemBreedingRod = new ItemBreederFuel() + AtomicContent.itemYellowCake = new ItemRadioactive().setUnlocalizedName("yellowcake").setTextureName("yellowcake").setCreativeTab(ResonantTab) AtomicContent.itemUranium = Atomic.contentRegistry.newItem(classOf[ItemUranium]).setCreativeTab(ResonantTab) GameRegistry.registerItem(AtomicContent.itemHazmatTop, "HazmatMask", "ResonantInduction|Atomic"); diff --git a/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java b/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java index 42f0a60a5..9e0545503 100644 --- a/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java +++ b/src/main/scala/resonantinduction/atomic/items/ItemAntimatter.java @@ -8,6 +8,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import resonantinduction.core.Reference; +import resonantinduction.core.ResonantTab; import java.util.List; @@ -21,6 +23,9 @@ public class ItemAntimatter extends ItemCell super(); this.setMaxDamage(0); this.setHasSubtypes(true); + this.setUnlocalizedName(Reference.prefix() + "antimatter"); + this.setTextureName(Reference.prefix() + "antimatter"); + setCreativeTab(ResonantTab.tab()); } @SideOnly(Side.CLIENT) diff --git a/src/main/scala/resonantinduction/atomic/items/ItemCell.java b/src/main/scala/resonantinduction/atomic/items/ItemCell.java index ae6c869dc..0fd293986 100644 --- a/src/main/scala/resonantinduction/atomic/items/ItemCell.java +++ b/src/main/scala/resonantinduction/atomic/items/ItemCell.java @@ -7,6 +7,8 @@ import net.minecraft.item.ItemStack; import resonant.content.prefab.itemblock.ItemTooltip; import resonant.lib.utility.LanguageUtility; import resonantinduction.atomic.AtomicContent; +import resonantinduction.core.Reference; +import resonantinduction.core.ResonantTab; public class ItemCell extends ItemTooltip { @@ -15,12 +17,14 @@ public class ItemCell extends ItemTooltip setContainerItem(AtomicContent.itemCell()); } - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) - { - this.itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().replace("item.", "")); - } + public ItemCell(String name) + { + if(!name.equalsIgnoreCase("cellEmpty")) + this.setContainerItem(AtomicContent.itemCell()); + this.setUnlocalizedName(Reference.prefix() + name); + this.setTextureName(Reference.prefix() + name); + setCreativeTab(ResonantTab.tab()); + } @Override public String getUnlocalizedName(ItemStack itemstack) diff --git a/src/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java b/src/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java deleted file mode 100644 index e507604e5..000000000 --- a/src/main/scala/resonantinduction/atomic/items/ItemDarkMatter.java +++ /dev/null @@ -1,19 +0,0 @@ -package resonantinduction.atomic.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; - -/** - * Strange matter cell - */ -public class ItemDarkMatter extends ItemCell -{ - @SideOnly(Side.CLIENT) - @Override - public void registerIcons(IIconRegister iconRegister) - { - // Animated IIcon - this.itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().replace("item.", "")); - } -} diff --git a/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java b/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java index 4c8e10f32..720ca9b75 100644 --- a/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java +++ b/src/main/scala/resonantinduction/atomic/items/ItemFissileFuel.java @@ -13,6 +13,8 @@ import resonant.api.IReactor; import resonant.api.IReactorComponent; import resonantinduction.atomic.AtomicContent; import resonantinduction.atomic.machine.reactor.TileReactorCell; +import resonantinduction.core.Reference; +import resonantinduction.core.ResonantTab; import resonantinduction.core.Settings; import universalelectricity.core.transform.vector.Vector3; @@ -46,6 +48,9 @@ public class ItemFissileFuel extends ItemRadioactive implements IReactorComponen this.setMaxStackSize(1); this.setMaxDamage(DECAY); this.setNoRepair(); + this.setUnlocalizedName(Reference.prefix() + "rodBreederFuel"); + this.setTextureName(Reference.prefix() + "rodBreederFuel"); + setCreativeTab(ResonantTab.tab()); } @Override diff --git a/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java b/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java index 2cf8cc050..88b17c8be 100644 --- a/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java +++ b/src/main/scala/resonantinduction/atomic/machine/accelerator/TileAccelerator.java @@ -17,7 +17,6 @@ import resonant.lib.utility.BlockUtility; import resonantinduction.atomic.Atomic; import resonantinduction.atomic.AtomicContent; import resonantinduction.atomic.items.ItemAntimatter; -import resonantinduction.atomic.items.ItemDarkMatter; import resonantinduction.core.Reference; import resonantinduction.core.Settings; import universalelectricity.core.transform.vector.Vector3; @@ -321,7 +320,7 @@ public class TileAccelerator extends TileElectricInventory implements IElectroma case 2: return itemStack.getItem() instanceof ItemAntimatter; case 3: - return itemStack.getItem() instanceof ItemDarkMatter; + return itemStack.getItem() != null && itemStack.getItem().getUnlocalizedName().contains("DarkMatter"); } return false;