Jump to content

[1.6.4][Solved] MetaData Item ID Is Conflicting With Regular Item ID


Recommended Posts

Posted

I have a metadata item, which looks for the id via the config file, and each of my ids are different, but when I load up the game the metadata item overrides the id of another item of mine, even thought they have there own ids.

 

Here my config:

 

 

package palaster97.star.core.config;

 

import java.io.File;

import java.util.logging.Level;

 

import net.minecraftforge.common.Configuration;

import cpw.mods.fml.common.FMLCommonHandler;

import cpw.mods.fml.common.FMLLog;

 

public class SConfig {

public static Configuration config;

 

public static int starID;

public static int diamondStickID;

 

public static int starCrafterID;

 

public static void init(File configFile) {

config = new Configuration(configFile);

 

try {

config.load();

 

starID = config.getItem("Star ID", 4000).getInt(4000);

diamondStickID = config.getItem("Diamond Stick ID", 4001).getInt(4001);

 

starCrafterID = config.getBlock("Star Crafter ID", 4003).getInt(4003);

 

FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[starMagic] Generated Main Config!");

} catch(Exception e) {

FMLLog.log(Level.SEVERE, e, "Star Magic has had a problem loading its configuration");

} finally {

if(config.hasChanged()) {

config.save();

}

}

}

}

 

 

 

Here where I call the items:

 

package palaster97.star.core.config;

 

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import palaster97.star.items.ItemDiamondStick;

import palaster97.star.items.ItemStar;

import palaster97.star.items.ItemStarParts;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

public class SItems {

 

public static Item star;

public static Item diamondStick;

public static Item starParts;

 

public static void init() {

star = new ItemStar(SConfig.starID);

diamondStick = new ItemDiamondStick(SConfig.diamondStickID);

starParts = new ItemStarParts(4002);

 

registerItemsLang();

}

 

private static void registerItemsLang() {

LanguageRegistry.addName(star, "Star");

LanguageRegistry.addName(diamondStick, "Diamond Stick");

for(int i = 0; i < ItemStarParts.names.length; i++) {

LanguageRegistry.addName(new ItemStack(starParts, 1, i), "Star Parts");

}

}

}

 

 

 

And here the metadata item

 

package palaster97.star.items;

 

import java.util.List;

 

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.util.Icon;

import net.minecraft.util.MathHelper;

import palaster97.star.StarMagic;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class ItemStarParts extends Item {

 

public static final String[] names = new String[] {"top", "tLeft", "tRight", "bLeft", "bRight"};

 

@SideOnly(Side.CLIENT)

private Icon[] icons;

 

public ItemStarParts(int par1) {

super(par1);

setUnlocalizedName("starParts");

setCreativeTab(StarMagic.tabStar);

setHasSubtypes(true);

setMaxDamage(0);

}

 

@Override

@SideOnly(Side.CLIENT)

public void registerIcons(IconRegister par1IconRegister) {

icons = new Icon[5];

 

for(int i = 0; i < icons.length; i++) {

icons = par1IconRegister.registerIcon("star:starParts" + "_" + i);

}

}

 

@Override

public Icon getIconFromDamage(int par1) {

return icons[par1];

}

 

@SuppressWarnings({ "unchecked", "rawtypes" })

@Override

@SideOnly(Side.CLIENT)

public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {

for (int x = 0; x < icons.length; x++) {

par3List.add(new ItemStack(this, 1, x));

}

}

 

@Override

public String getUnlocalizedName(ItemStack par1ItemStack) {

int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15);

    return super.getUnlocalizedName() + "." + names;

}

}

 

 

Posted

Why is this:

new ItemStarParts(4002);

Not using a config based ID?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

I forgot to change it back to the config, but the new ItemStarParts(4002);, is the only way it works when it is set, but when I paste in here if forgot to change it to new ItemStarParts(SConfig.starPartsID);, it was a paste error.

Posted

Srry, here is the code with error

 

Config:

 

 

package palaster97.star.core.config;

 

import java.io.File;

import java.util.logging.Level;

 

import net.minecraftforge.common.Configuration;

import cpw.mods.fml.common.FMLCommonHandler;

import cpw.mods.fml.common.FMLLog;

 

public class SConfig {

public static Configuration config;

 

public static int starID;

public static int diamondStickID;

public static int starPartsID;

 

public static int starCrafterID;

 

public static void init(File configFile) {

config = new Configuration(configFile);

 

try {

config.load();

 

starID = config.getItem("Star ID", 4000).getInt(4000);

diamondStickID = config.getItem("Diamond Stick ID", 4001).getInt(4001);

starPartsID = config.getItem("Star Parts ID", 4002).getInt(4002);

 

starCrafterID = config.getBlock("Star Crafter ID", 4003).getInt(4003);

 

FMLCommonHandler.instance().getFMLLogger().log(Level.INFO, "[starMagic] Generated Main Config!");

} catch(Exception e) {

FMLLog.log(Level.SEVERE, e, "Star Magic has had a problem loading its configuration");

} finally {

if(config.hasChanged()) {

config.save();

}

}

}

}

 

 

 

ItemStarParts:

 

 

package palaster97.star.items;

 

import java.util.List;

 

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraft.util.Icon;

import net.minecraft.util.MathHelper;

import palaster97.star.StarMagic;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class ItemStarParts extends Item {

 

public static final String[] names = new String[] {"top", "tLeft", "tRight", "bLeft", "bRight"};

 

@SideOnly(Side.CLIENT)

private Icon[] icons;

 

public ItemStarParts(int par1) {

super(par1);

setUnlocalizedName("starParts");

setCreativeTab(StarMagic.tabStar);

setHasSubtypes(true);

setMaxDamage(0);

}

 

@Override

@SideOnly(Side.CLIENT)

public void registerIcons(IconRegister par1IconRegister) {

icons = new Icon[5];

 

for(int i = 0; i < icons.length; i++) {

icons = par1IconRegister.registerIcon("star:starParts" + "_" + i);

}

}

 

@Override

public Icon getIconFromDamage(int par1) {

return icons[par1];

}

 

@SuppressWarnings({ "unchecked", "rawtypes" })

@Override

@SideOnly(Side.CLIENT)

public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {

for (int x = 0; x < icons.length; x++) {

par3List.add(new ItemStack(this, 1, x));

}

}

 

@Override

public String getUnlocalizedName(ItemStack par1ItemStack) {

int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15);

    return super.getUnlocalizedName() + "." + names;

}

}

 

 

 

Here where I call the Item:

 

 

package palaster97.star.core.config;

 

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import palaster97.star.items.ItemDiamondStick;

import palaster97.star.items.ItemStar;

import palaster97.star.items.ItemStarParts;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

public class SItems {

 

public static Item star;

public static Item diamondStick;

public static Item starParts;

 

public static void init() {

star = new ItemStar(SConfig.starID);

diamondStick = new ItemDiamondStick(SConfig.diamondStickID);

starParts = new ItemStarParts(SConfig.starPartsID);

 

registerItemsLang();

}

 

private static void registerItemsLang() {

LanguageRegistry.addName(star, "Star");

LanguageRegistry.addName(diamondStick, "Diamond Stick");

for(int i = 0; i < ItemStarParts.names.length; i++) {

LanguageRegistry.addName(new ItemStack(starParts, 1, i), "Star Parts");

}

}

}

 

 

Posted

Srry, here is the code with error

 

You have not included the error.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Srry again, here is what the console spits out when I load minecraft, and the metadata item overrides the regular item

 

 

Oct 20, 2013 1:53:49 PM net.minecraft.launchwrapper.LogWrapper log

INFO: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

Oct 20, 2013 1:53:49 PM net.minecraft.launchwrapper.LogWrapper log

INFO: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

Oct 20, 2013 1:53:49 PM net.minecraft.launchwrapper.LogWrapper log

INFO: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

2013-10-20 13:53:49 [iNFO] [ForgeModLoader] Forge Mod Loader version 6.4.29.931 for Minecraft 1.6.4 loading

2013-10-20 13:53:49 [iNFO] [ForgeModLoader] Java is Java HotSpot Client VM, version 1.7.0_45, running on Windows Vista:x86:6.0, installed at C:\Program Files\Java\jre7

2013-10-20 13:53:49 [iNFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

2013-10-20 13:53:49 [WARNING] [ForgeModLoader] The coremod codechicken.core.launch.CodeChickenCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft

2013-10-20 13:53:50 [WARNING] [ForgeModLoader] The coremod codechicken.nei.asm.NEICorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft

2013-10-20 13:53:50 [iNFO] [sTDOUT] Loaded 40 rules from AccessTransformer config file fml_at.cfg

2013-10-20 13:53:50 [iNFO] [sTDOUT] Loaded 109 rules from AccessTransformer config file forge_at.cfg

2013-10-20 13:53:50 [iNFO] [sTDOUT] Loaded 40 rules from AccessTransformer config file fml_at.cfg

2013-10-20 13:53:50 [sEVERE] [ForgeModLoader] The binary patch set is missing. Either you are in a development environment, or things are not going to work!

2013-10-20 13:53:51 [iNFO] [sTDOUT] Adding AccessTransformer: nei_at.cfg

2013-10-20 13:53:51 [iNFO] [sTDOUT] Adding Accesstransformer map: temp.dat

2013-10-20 13:53:51 [iNFO] [sTDOUT] Loaded 54 rules from AccessTransformer config file temp.dat

2013-10-20 13:53:51 [iNFO] [ForgeModLoader] Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

2013-10-20 13:53:51 [iNFO] [ForgeModLoader] Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

2013-10-20 13:53:51 [iNFO] [ForgeModLoader] Launching wrapped minecraft {net.minecraft.client.main.Main}

2013-10-20 13:53:52 [iNFO] [sTDOUT] Inserted super call into net.minecraft.client.gui.inventory.GuiInventory.updateScreen

2013-10-20 13:53:52 [iNFO] [sTDOUT] awy was overriden from NotEnoughItems 1.6.1.5.jar

2013-10-20 13:53:53 [iNFO] [Minecraft-Client] Setting user: Player923

2013-10-20 13:53:53 [iNFO] [sTDOUT] Generated BlockMobSpawner helper method.

2013-10-20 13:53:54 [iNFO] [Minecraft-Client] LWJGL Version: 2.9.0

2013-10-20 13:53:55 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default

2013-10-20 13:53:56 [iNFO] [MinecraftForge] Attempting early MinecraftForge initialization

2013-10-20 13:53:56 [iNFO] [sTDOUT] MinecraftForge v9.11.1.931 Initialized

2013-10-20 13:53:56 [iNFO] [ForgeModLoader] MinecraftForge v9.11.1.931 Initialized

2013-10-20 13:53:56 [iNFO] [sTDOUT] Replaced 101 ore recipies

2013-10-20 13:53:56 [iNFO] [MinecraftForge] Completed early MinecraftForge initialization

2013-10-20 13:53:56 [iNFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Pat\Desktop\Pat's Stuff\Game\Minecraft\dev\forge 931\mcp\jars\config\logging.properties

2013-10-20 13:53:56 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL

2013-10-20 13:53:56 [iNFO] [ForgeModLoader] Searching C:\Users\Pat\Desktop\Pat's Stuff\Game\Minecraft\dev\forge 931\mcp\jars\mods for mods

2013-10-20 13:53:56 [iNFO] [ForgeModLoader] Also searching C:\Users\Pat\Desktop\Pat's Stuff\Game\Minecraft\dev\forge 931\mcp\jars\mods\1.6.4 for mods

2013-10-20 13:54:00 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 6 mods to load

2013-10-20 13:54:00 [iNFO] [mcp] Activating mod mcp

2013-10-20 13:54:00 [iNFO] [FML] Activating mod FML

2013-10-20 13:54:00 [iNFO] [Forge] Activating mod Forge

2013-10-20 13:54:00 [iNFO] [CodeChickenCore] Activating mod CodeChickenCore

2013-10-20 13:54:00 [iNFO] [NotEnoughItems] Activating mod NotEnoughItems

2013-10-20 13:54:00 [iNFO] [starMagic] Activating mod StarMagic

2013-10-20 13:54:00 [WARNING] [Forge Mod Loader] Mod Forge Mod Loader is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:00 [WARNING] [Minecraft Forge] Mod Minecraft Forge is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:00 [WARNING] [Not Enough Items] Mod Not Enough Items is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:00 [WARNING] [star Magic] Mod Star Magic is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:00 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Not Enough Items, FMLFileResourcePack:Star Magic

2013-10-20 13:54:00 [iNFO] [ForgeModLoader] FML has found a non-mod file CodeChickenLib-dev-1.6.4-1.0.0.36.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.

2013-10-20 13:54:00 [iNFO] [ForgeModLoader] Registering Forge Packet Handler

2013-10-20 13:54:00 [iNFO] [ForgeModLoader] Succeeded registering Forge Packet Handler

2013-10-20 13:54:00 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0

2013-10-20 13:54:00 [iNFO] [ForgeModLoader] [starMagic] Generated Main Config!

2013-10-20 13:54:00 [iNFO] [sTDOUT] CONFLICT @ 4001 item slot already occupied by palaster97.star.items.ItemDiamondStick@b97d8a while adding palaster97.star.items.ItemStarParts@1e103e9

2013-10-20 13:54:00 [iNFO] [fml.ItemTracker] The mod StarMagic is overwriting existing item at 4257 (palaster97.star.items.ItemDiamondStick from StarMagic) with palaster97.star.items.ItemStarParts

2013-10-20 13:54:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/blocks/starCrafter.png

2013-10-20 13:54:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_0.png

2013-10-20 13:54:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_1.png

2013-10-20 13:54:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_2.png

2013-10-20 13:54:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_3.png

2013-10-20 13:54:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_4.png

2013-10-20 13:54:01 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/star.png

2013-10-20 13:54:01 [iNFO] [sTDOUT] Removing TMI Uninstaller

2013-10-20 13:54:01 [iNFO] [sTDOUT] Deleting Dir: C:\Users\Pat\Desktop\Pat's Stuff\Game\Minecraft\dev\eclipse\Minecraft\bin\net\minecraft\client\TMIUninstaller

2013-10-20 13:54:01 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 6 mods

2013-10-20 13:54:01 [WARNING] [Forge Mod Loader] Mod Forge Mod Loader is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:01 [WARNING] [Minecraft Forge] Mod Minecraft Forge is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:01 [WARNING] [Not Enough Items] Mod Not Enough Items is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:01 [WARNING] [star Magic] Mod Star Magic is missing a pack.mcmeta file, things may not work well

2013-10-20 13:54:01 [iNFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Not Enough Items, FMLFileResourcePack:Star Magic

2013-10-20 13:54:02 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_0.png

2013-10-20 13:54:02 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_1.png

2013-10-20 13:54:02 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_2.png

2013-10-20 13:54:02 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_3.png

2013-10-20 13:54:02 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/starParts_4.png

2013-10-20 13:54:02 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/items/star.png

2013-10-20 13:54:02 [sEVERE] [Minecraft-Client] Using missing texture, unable to load: star:textures/blocks/starCrafter.png

2013-10-20 13:54:02 [iNFO] [sTDOUT]

2013-10-20 13:54:02 [iNFO] [sTDOUT] Starting up SoundSystem...

2013-10-20 13:54:02 [iNFO] [sTDOUT] Initializing LWJGL OpenAL

2013-10-20 13:54:02 [iNFO] [sTDOUT]    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

2013-10-20 13:54:03 [sEVERE] [Minecraft-Client] ########## GL ERROR ##########

2013-10-20 13:54:03 [sEVERE] [Minecraft-Client] @ Pre render

2013-10-20 13:54:03 [sEVERE] [Minecraft-Client] 1280: Invalid enum

2013-10-20 13:54:03 [iNFO] [sTDOUT] OpenAL initialized.

2013-10-20 13:54:03 [iNFO] [sTDOUT]

2013-10-20 13:54:03 [sEVERE] [Minecraft-Client] Realms: Invalid session id

 

 

Posted

I checked the config, for my mod, and it does show that star parts(metadata item), is the same id for diamonds sticks. So I' am going to delete it and retry it.

 

Edit 1:

I deleted the config for my mod, and restarted minecraft, and it worked, thx you :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.