Everything posted by princeshaka
-
1.7.10 Game Registry Problem (Solved)
Yes! Everything seems to be working now! Thanks to the 3 of you for the help.
-
1.7.10 Game Registry Problem (Solved)
Yeah I forgot the this.setCreativeTab(Main.tabMineout); The ItemsMO.init() was something i was missing, it goes in the pre Init section correct?
-
1.7.10 Game Registry Problem (Solved)
There's no pink and black box like all the other un-textured stuff in the creative tab. I also cant use the give command to give it to myself.
-
1.7.10 Game Registry Problem (Solved)
ItemGun class package net.mineout.mod.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.mineout.mod.Main; import net.mineout.mod.entity.projectiles.EntityBullet; import static net.mineout.mod.items.ItemDecMO. *; public class ItemGun extends Item { private Item Ammo; public ItemGun(Item x){ this.Ammo = x; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(Ammo)) { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityBullet(par2World, par3EntityPlayer)); } } return par1ItemStack; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(Main.modID + ":" + this.getUnlocalizedName().substring(5)); } }
-
1.7.10 Game Registry Problem (Solved)
Ok so now it looks like this: ItemsMO class package net.mineout.mod.items; import static net.mineout.mod.items.ItemDecMO. *; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.item.Item; public class ItemsMO { public static void init() { registerItems(); } public static void registerItems() { //Ammo item308Ammo = registerItem(new SimpleItemsMO().setUnlocalizedName("308Ammo")); item32Ammo = registerItem(new SimpleItemsMO().setUnlocalizedName("32Ammo")); item44MagnumAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("44MagnumAmmo")); item10mmAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("10mmAmmo")); item12GaugeAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("12GaugeAmmo")); item556mmAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("556Ammo")); item5mmAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("5mmAmmo")); itemAlienPowerCellAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("AlienPowerCellAmmo")); itemAlienPowerModuleAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("AlienPowerModuleAmmo")); itemBBAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("BBAmmo")); itemElectronChargePackAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("ElectronChargePackAmmo")); itemFlamethrowerFuelAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("FlamethrowerFuelAmmo")); itemMesmetronPowerCellAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MesmetronPowerCellAmmo")); itemMicrofusionCellAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MicrofusionCellAmmo")); itemMiniNukeAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MiniNukeAmmo")); itemMisileAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MisileAmmo")); itemRailwaySpikesAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("RailwaySpikesAmmo")); //Guns item10mmPistol = registerItem(new ItemGun(item10mmAmmo).setUnlocalizedName("10mmPistol")); } public static Item registerItem(Item item) { GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); return item; } } Unfortunately its still not registering the item10mmPistol.
-
1.7.10 Game Registry Problem (Solved)
Do you mean like the initialization?
-
1.7.10 Game Registry Problem (Solved)
ItemDecMO Class package net.mineout.mod.items; import net.minecraft.item.Item; public class ItemDecMO { //Ammo public static Item item308Ammo; public static Item item32Ammo; public static Item item44MagnumAmmo; public static Item item10mmAmmo; public static Item item12GaugeAmmo; public static Item item556mmAmmo; public static Item item5mmAmmo; public static Item itemAlienPowerCellAmmo; public static Item itemAlienPowerModuleAmmo; public static Item itemBBAmmo; public static Item itemDartAmmo; public static Item itemElectronChargePackAmmo; public static Item itemEnergyCellAmmo; public static Item itemFlamethrowerFuelAmmo; public static Item itemMesmetronPowerCellAmmo; public static Item itemMicrofusionCellAmmo; public static Item itemMiniNukeAmmo; public static Item itemMisileAmmo; public static Item itemRailwaySpikesAmmo; //Guns public static Item item10mmPistol; } ItemsMO class package net.mineout.mod.items; import static net.mineout.mod.items.ItemDecMO. *; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.item.Item; public class ItemsMO { public static void init() { registerItems(); } public static void registerItems() { //Guns item10mmPistol = registerItem(new ItemGun(item10mmAmmo).setUnlocalizedName("10mmPistol")); //Ammo item308Ammo = registerItem(new SimpleItemsMO().setUnlocalizedName("308Ammo")); item32Ammo = registerItem(new SimpleItemsMO().setUnlocalizedName("32Ammo")); item44MagnumAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("44MagnumAmmo")); item10mmAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("10mmAmmo")); item12GaugeAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("12GaugeAmmo")); item556mmAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("556Ammo")); item5mmAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("5mmAmmo")); itemAlienPowerCellAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("AlienPowerCellAmmo")); itemAlienPowerModuleAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("AlienPowerModuleAmmo")); itemBBAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("BBAmmo")); itemElectronChargePackAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("ElectronChargePackAmmo")); itemFlamethrowerFuelAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("FlamethrowerFuelAmmo")); itemMesmetronPowerCellAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MesmetronPowerCellAmmo")); itemMicrofusionCellAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MicrofusionCellAmmo")); itemMiniNukeAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MiniNukeAmmo")); itemMisileAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("MisileAmmo")); itemRailwaySpikesAmmo = registerItem(new SimpleItemsMO().setUnlocalizedName("RailwaySpikesAmmo")); } public static Item registerItem(Item item) { GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); return item; } } ItemGun class package net.mineout.mod.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.mineout.mod.Main; import net.mineout.mod.entity.projectiles.EntityBullet; import static net.mineout.mod.items.ItemDecMO. *; public class ItemGun extends Item { private Item Ammo; public ItemGun(Item x){ this.Ammo = x; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(Ammo)) { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityBullet(par2World, par3EntityPlayer)); } } return par1ItemStack; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(Main.modID + ":" + this.getUnlocalizedName().substring(5)); } }
-
1.7.10 Game Registry Problem (Solved)
This is what I am trying to register: item10mmPistol = registerItem(new ItemGun(item10mmAmmo).setUnlocalizedName("10mmPistol")); item10mmPistol is what I have registered already, and item10mmAmmo is another item I have registered that I wish to use as a consumable. The problem is when I run it, the item10mmPistol, is no longer registered. It seems as though it just re-registers item10mmAmmo. I am just wondering if anyone has any ideas as to how to get around this problem. Everything has already been registered and textured before, its just when I have tried to put an already registered item into this constructor, things seem to mess up.
IPS spam blocked by CleanTalk.