Jump to content

tminor1

Members
  • Posts

    103
  • Joined

  • Last visited

Everything posted by tminor1

  1. In eclipse I clicked file, export, jar
  2. So I have all the items and the textures and the crafting all working. So I then exported the code to a jar file I then put it in the mods folder and tried to run minecraft. (Because now that the mod is done I need to see if it will work with the real minecraft outside of eclipse.) But when I run it the game crashes and tells me java.lang.NoSuchMethodError: net.SandItems.mod.items.SandPickaxe.getCreativeTab()Lnet/minecraft/creativetab/CreativeTabs;. Here is the code for SandPickaxe.java. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ package net.SandItems.mod.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.SandItems.mod.SandItems; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemPickaxe; import net.minecraft.creativetab.CreativeTabs; public class SandPickaxe extends ItemPickaxe { public SandPickaxe(ToolMaterial p_i45347_1_) { super(p_i45347_1_); this.setCreativeTab(getCreativeTab().tabTools); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconRegister) { this.itemIcon = iconRegister.registerIcon(SandItems.modid + ":" + this.getUnlocalizedName().substring(5)); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So I first tried to import the net.minecraft.creativetab.CreativeTabs but it still gave me the same message. Then I tried changing this.setCreativeTab(getCreativeTab().tabTools); to this.setCreativeTab(CreativeTabs.tabTools); but Then it just gave me a crash again. What am I doing wrong?
  3. I am sorry I am new to modding and I just want to make sure that I under stand. So from what I am getting is that I need to take my main file that would look this. package net.Fly.mod; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; @Mod(modid = FlyMod.modid, version = FlyMod.version) public class SandItems { public static final String modid = "FlyMod"; public static final String version = "v1.0"; @EventHandler public void PreInit(FMLPreInitializationEvent preEvent){ } @EventHandler public void Init(FMLInitializationEvent event){ } @EventHandler public void PostInit(FMLPostInitializationEvent PostEvent){ } } I would need to import the PlayerickEvent then I need to put player.capabilities.alowFlying = ture all in here. Or do I hava to create a new class and do that in. I am sorry that I don't understand I am new to modding so I don't know how overriding minecraft code stuff works.
  4. Ok but how would I write that would I put it in my main class under the EventHandlers or do I have to make a new class file and extend off of the minecraft world pakage?
  5. Hey so I was wondering how do I make a mod that tells mincraft to allow people to fly in survival. I think the way you would do it would be to tell minecraft to use you code instead of its code that way you set allowflying to true and minecraft will go by your allowflying instead of using its allowflying. How would I do something like that, or is there a way to change things in the game without having to tell minecraft to use you code and not its code?
  6. Hey I want to learn how to make a mod with forge but I am having a problem. I have posted about my problem in my sandStoneItems topic but no one replied to me. So I thought that well my topic had just moved of the list. Then after a while I posted about my problem again and no one replied. I even posted about it on the minecraft forum no one replied. Why will no one help me with my problem with using Forge Gradlew?
  7. Ok so I ran ForgeGradlew.bat. It did some things then told me this "Cannot find System Java Compiler. Ensure that you have installed JDK (not just a JRE) and configure your JAVA_HOME system variable to point to the according directory." Well I do have JDK installed and I have it in my system path like this. "c:\Program Files (x86)\Java\jdk1.7.0_45\bin" Is this wrong? Do I need to change or add something? What do I need to do to make this work because Eclipse works fine and so does MCP so why is this happening?
  8. Well I got eclipse working and I am using it to fix up my code but there is one problem. Most of the problems that I am getting is that eclipse needs to reed the code from minecraft and minecraft forge. I can get the minecraft code from MCP. but how do I get the forge code?
  9. Well I will use eclipse if I could get it working.
  10. Never mind about the error I was complaining about I figured out what I needed to do there. Now I need to get the code working.
  11. Hey so I don't have eclipse working but I was just looking online for some help that was for 1.7.2 and I found this. http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571559-1-7-2-source-code-forge-modding-tutorials Then I made these. ~~~~~~~~~~~~~~~~~~~~~ Mod.java ~~~~~~~~~~~~~~~~~~~~~ package net.sandItems.mod; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import net.sandIems.mod.SandPick; import net.minecraft.creativetab.CreativeTabs; @Mod(modid = SandItems.modid, version = SandItems.version) public class Mod { public static final String modid = "SandItems"; public static final String version = "0.1 MC1.7.2"; @EventHandler { public static final Item.ToolMaterial CUSTOM = EnumHelper.addToolMaterial("CUSTOM", 2, 131, 1.0F, 1.5F, 5); public void preInit(FMLPreInitializationEvent event) } @EventHandler public void preInit(FMLPreInitializationEvent event) { SandPickaxe = new CustomPickaxe(CUSTOM).setUnlocalizedName("SandPickaxe").setCreativeTab (CreativTabs.tabTools).setTextureName("Pick"); GameRegistry.registerItem(SandPickaxe, "SandPickaxe") } } ~~~~~~~~~~~~~~~ SandPick.java ~~~~~~~~~~~~~~~ package net.sandItems.mod; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.Item.ToolMaterial; public class SandPick extends ItemPickaxe { public CustomPickaxe(ToolMaterial material) { super(material); } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So again I wanted to see if this code would work. So I decided I was going to compile Mod.java first then SandPick.java. However when I got on cmd and typed javac Mod it gave me that same error that I posted about above.
  12. I do have JDK installed that is how I use MCP also.
  13. Ok well I tried to use eclipse but it would not work it kept telling me it could not find c:/Program Files(x86)/java/jre7/bin/client/jvm.dill I do have java in my system path so I don't know why it is doing this.
  14. First of all you asking me how was i even able to use it. I don't know if it would even work when I use the -javac command it gives me that error. I need to convert the java files to class files to put them in a .jar file. Also I don't use eclips. It takes up a lot of memory. And you can use cmd and the -javac command to convert .java files in to .class. but it gives me that error. So if it was giving that error with cmd I don't see how eclips would have any different outcome. As for that page I found it was the first thing I found that would help me add items. I am using 1.7.2. I mainly want to know why it gives me that error when I try to convert the .java files for my mod to .class files. No where on any how to that I found does it tell you how to do that and tell you what to do if you get an error.
  15. Hi so I am trying to learn how to make mods with minecraft forge. So i decided to start simple with adding a new item to the game. So I found thins page that I used to help me. http://www.minecraftforum.net/forums/archive/tutorials/930012-creating-mods-minecraft-forge-28-1-12 So I used that page to try to add a new pickaxe to the game that is made out of sandstone. I don't have crafting for it yet I just wanted to see if I could add it. I will try to get the crafting working after I at least can get the item in the game. Here is the code. This is for Mod.java ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ package net.minecraft.src; import net.minecraft.src.forge.*; public class mod_SandItems extends BaseMod { static EnumToolMaterial toolTITANIUM = EnumHelper.addToolMaterial("TITANIUM", 2, 500, 7F, 3, 9); public static final Item sandstonePickaxe = (new SandstonePickaxe(999, toolTITANIUM)).setIconCoord(0, 3).setItemName("sandstonePickaxe"); public mod_SandItems() { } public void load() { MinecraftForgeClient.preloadTexture("/SandTtems/Texture/Pick.png"); MinecraftForge.setToolClass(sandPick, "pickaxe", 2); } public String getVersion() { return "1.0.0"; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is for SandPick.java ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ package net.minecraft.src; import net.minecraft.src.forge.*; public class SandPick extends ItemPickaxe implements ITextureProvider { protected ItemPickaxe(int i, EnumToolMaterial enumtoolmaterial) { super(i, enumtoolmaterial); } public String getTextureFile() { return "/SandItems/Texture/Pick.png"; } } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ So after I got all that the next thing I needed to do was convert the .java files in to .class files then put them in to a .jar file. However when I run the javac command it gives me an error like this. error: Class names, 'Mod' , are only accepted if annotation processing is explicitly requested. I don't know why. Also if there is anything I need to add to my code pleas tell me.
×
×
  • Create New...

Important Information

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