
minecraftdotjarrr
Members-
Posts
52 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
minecraftdotjarrr's Achievements

Stone Miner (3/8)
1
Reputation
-
I did not manage to find the method that returns: "tile. + classvariable" Here is the code with every thing I have I will post my Item code that I have too, just incase there is something wrong there too, and I am sorry if my code is not perfect and or messy. Main Class package com.somemorefood.friendlyunicorns; import net.minecraft.block.Block; import net.minecraft.item.Item; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = Reference.MODID, version = Reference.VERSION) public class SomeMoreFood { public static Block exampleBlock; public static Item grannySmith; @EventHandler public void preInit(FMLPreInitializationEvent event) { grannySmith = new ItemGrannySmith(); RegisterHelper.registerItem(grannySmith); exampleBlock = new BlockExampleBlock(); RegisterHelper.registerBlock(exampleBlock); } } Register Helper package com.somemorefood.friendlyunicorns; import net.minecraft.block.Block; import net.minecraft.item.Item; import cpw.mods.fml.common.registry.GameRegistry; public class RegisterHelper { public static void registerBlock(Block block) { GameRegistry.registerBlock(block, Reference.MODID + block.getUnlocalizedName().substring(5)); } public static void registerItem(Item item) { GameRegistry.registerItem(item, Reference.MODID + item.getUnlocalizedName().substring(5)); } } My Item Class (Granny Smith Apple, Not done yet, but I did by the way add it in successfully) package com.somemorefood.friendlyunicorns; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; public class ItemGrannySmith extends ItemFood { public ItemGrannySmith () { super(4, 0.5F, false); setUnlocalizedName ("grannySmith"); setTextureName (Reference.MODID + ":" + getUnlocalizedName().substring(5)); setCreativeTab(CreativeTabs.tabFood); } } Example Bock, there is another problem with this class too, I cannot add the material type (error). I think due to the register block, correct me if I am wrong. package com.somemorefood.friendlyunicorns; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class BlockExampleBlock extends Block { public BlockExampleBlock() { super(Material.rock); } }
-
Main@Mod(modid = Reference.MODID, version = Reference.VERSION) public class SomeMoreFood { public static Block exampleBlock; public static Item grannySmith; @EventHandler public void preInit(FMLPreInitializationEvent event) { grannySmith = new ItemGrannySmith(); RegisterHelper.registerItem(grannySmith); exampleBlock = new BlockExampleBlock(); RegisterHelper.registerBlock(exampleBlock); } } Register Helper Class package com.somemorefood.friendlyunicorns; import net.minecraft.block.Block; import net.minecraft.item.Item; import cpw.mods.fml.common.registry.GameRegistry; public class RegisterHelper { public static void registerBlock(Block block) { GameRegistry.registerBlock(block, Reference.MODID + block.getUnlocalizedName().substring(5)); } public static void registerItem(Item item) { GameRegistry.registerItem(item, Reference.MODID + item.getUnlocalizedName().substring(5)); } }
-
No you are not! I just can't see what is wrong with it either. The method getUnlocalizedName() is undefined for the type Block I noticed "Block" has an uppercase letter at the start (in the error message). So I was like okay ill just change: block.getUnlocalizedName() to Block.getUnlocalizedName() but that made no difference.
-
package com.somemorefood.friendlyunicorns; import net.minecraft.block.Block; import net.minecraft.item.Item; import cpw.mods.fml.common.registry.GameRegistry; public class RegisterHelper { public static void registerBlock(Block block) { GameRegistry.registerBlock(block, Reference.MODID + "_" + block.getUnlocalizedName().substring(5)); } public static void registerItem(Item item) { GameRegistry.registerItem(item, Reference.MODID + "_" + item.getUnlocalizedName().substring(5)); } }
-
As I feel very dumb spelling my title and Unlocalized wrong, I spelled it wrong when I was giving the example. So first off I am sorry for that. But for when I do spell it right: GameRegistry.registerBlock(Block, Reference.MODID + "_" + block.getUnlocalizedName().substring(5)); I still do get the same error, it says that: The method getUnlocalizedName() is undefined for the type Block. And the solution that it suggests is that I should add a cast to block. This post made me look very dumb and I could tell you that over and over again lol, but I do know that eclipse has a auto correct sort of thing that you were talking about and I do know how to use it. getUnlocalizedName() was not an option when I wrote: block. Thank you and sorry again for this horrible mistake.
-
Hello! I am trying to add a block to the game, as you can tell and I had a question about this piece of code: GameRegistry.registerBlock(block, Reference.MODID + "_" + block.getUnlocalizedName() .substring(5)); in particular; the block.getUnlocalizedName() .getUnlocalizedName is underlined red and says: The method getUnlocalizedName() is undefined for the type Block. Now that confuses me because didn't we just register Block in: public void registerBlock (Block block) Anyways I have added a item using: public static void registerItem(Item item) { GameRegistry.registerItem(item, Reference.MODID + "_" + item.getUnlocalizedName().substring(5)); } and it worked fine. Another thing is that when I go into my block class and try to change the "material" it does not display the actual types it displays the functions. Sorry in advance for this very stupid question, but I don't know what to do about it. If anyone could tell me what I am doing wrong that would be wonderful, thank you!
-
do you think this may be the problem? par2World.spawnEntityInWorld(new VikingSword_Entity(par2World, par3EntityPlayer));?