Fixed ItemCell textures

This commit is contained in:
Robert S 2014-09-09 03:50:59 -04:00
parent cced70d5ab
commit 5d92c562b5
6 changed files with 31 additions and 37 deletions

View file

@ -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");

View file

@ -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)

View file

@ -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)

View file

@ -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.", ""));
}
}

View file

@ -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

View file

@ -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;