Jump to content

Recommended Posts

Posted

I am having issues setting up MCP and Forge in IntelliJ IDEA. It seems run minecraft fine but gives me a few errors and I have tried multiple ways to try and fix it with no luck.

 

It seems to think some files are the same names yet my mod files are empty they are just folders at the moment.

 

It also seems to be having issues with the rt.jar file from the JDK and I have updated and reinstalled it a few times now.

 

I have tried to pull a project in from Eclipse and I still get the same errors.

 

 

  Reveal hidden contents

 

 

Thanks

 

Posted

MCP comes with it's own eclipse folder setup for working with eclipse, if you are using a different IDE I guess you have to setup everything on your own. But if you get the code working with eclipse without using the mcp/eclipse folder as the workspace for eclipse then I see no reason why your IDE shouldnt work as well...

 

Have you tried looking at the IntelliJ's forums for support with that specific IDE?

  Quote

If you guys dont get it.. then well ya.. try harder...

Posted

There is only one post on their forums and it links back to a post on the minecraft forums. That post only covers setting up the MCP without forge, which shouldn't be any different other than adding the extra jars from the lib folder that forge pulls in. Doing it that way nets me the same results however.

 

Not really sure what else to try to do to fix the issue.

 

Thanks

Posted

I'm developing my mod in intellij for some (few months) and I wasn't able to get rid of this. It's probably connected to the IDE's passing of classpath, but I wasn't able to solve it. Well, to be honest I didn't tried really hard, it does not affect anything...

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

Posted

Well I think part of the issue with it thinking that the mod has files with the same name is where it runs the test environment. I managed to get it to stop giving me those issues after I made my own eclipse workspace then imported that but I am still trying to figure out how to get the same results without importing it from eclipse.

 

I was curious if it affected anything when trying to create a mod. Me personally I would like to have a test environment that is error free otherwise it can make it difficult to know what is causing what errors.

Posted
  On 3/9/2013 at 10:03 AM, Wikid said:
Me personally I would like to have a test environment that is error free

I'd like that too, but if I can't figure it out, I'll live with it.

 

  Quote
otherwise it can make it difficult to know what is causing what errors.

not really, I'm working even with coremod code wihout any problems. after few days/weeks I got used to those lines and now I automatically ignore them. (although this could be an issue, if you're going to work on FML)

 

but if you find a solution, please do share with us, I'd still like the output to be nice and clean ;D.

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

  • 3 weeks later...
Posted
  On 3/8/2013 at 1:01 AM, Wikid said:
2013-03-07 18:54:36 [sEVERE] [ForgeModLoader] There was a problem reading the entry java/lang/Object.class in the jar C:\Program Files\Java\jdk1.7.0_17\jre\lib\rt.jar - probably a corrupt zip

 

There is a known problem with running a re-compiled Minecraft client under Java 1.7 - try installing 1.6 as well, then ensure your project SDK is set to use the 1.6 JDK.

Posted
  On 3/8/2013 at 1:01 AM, Wikid said:
2013-03-07 18:54:36 [sEVERE] [ForgeModLoader] There was a problem reading the entry java/lang/Object.class in the jar C:\Program Files\Java\jdk1.7.0_17\jre\lib\rt.jar - probably a corrupt zip

This is because IntelliJ IDEA puts all of the java libs in the classpath, and for whatever reason Forge cannot read that jar file. The real fix would be for Forge to catch this error gracefully. One workaround is to make a new JDK in IDEA (CTRL+ALT+SHIFT+S, SDKs on the left, plus at the top, point to your 1.7 JDK install) and remove all of the classpath jars. Then use this alternative JRE in your run configuration.

 

  Quote

2013-03-07 18:54:36 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.BaseMod. This is generally a severe programming error.  There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!

 

This is from Forge making sure that net.minecraft.src packages are only inside the minecraft jar. I am assuming you are recompiling the whole Minecraft source in IDEA, so the Minecraft jar is actually your output folder. You need to reorder the dependencies of this module so that the <module source> is the first entry, not the java JDK. In any other child modules that depend on this module, you will need to make sure this module comes first on the dependency list before the child's <module source>.

  • 1 month later...
Posted
  On 3/8/2013 at 1:01 AM, Wikid said:
2013-03-07 18:54:36 [sEVERE] [ForgeModLoader] There was a problem reading the entry java/lang/Object.class in the jar C:\Program Files\Java\jdk1.7.0_17\jre\lib\rt.jar - probably a corrupt zip

 

How to fix this error:

Edit cpw.mods.fml.common.discovery.JarDiscoverer.java to include the following: (the first few lines are context and are in the discover method)

 

  Reveal hidden contents

 

After you have modified the source, run the recompile script from mcp and you should have no more errors.

 

  Quote

  Quote

2013-03-07 18:54:36 [sEVERE] [ForgeModLoader] FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.BaseMod. This is generally a severe programming error.  There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!

 

This is from Forge making sure that net.minecraft.src packages are only inside the minecraft jar. I am assuming you are recompiling the whole Minecraft source in IDEA, so the Minecraft jar is actually your output folder. You need to reorder the dependencies of this module so that the <module source> is the first entry, not the java JDK. In any other child modules that depend on this module, you will need to make sure this module comes first on the dependency list before the child's <module source>.

This works very well for the other errors. Thank you!

 

I now have a completely clean run (except for the LWGL error and the 1.6 release flag error, but those can be ignored)

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • just rewatched the tutorial and my code is exactly the same as kaupenjoe's.  the item is added into the game but like i said to start it doesnt have a texture or a proper name for whatever reason.
    • yes the name is en_us.json and it is in resources -> assests -> testmod -> lang folders.  i have checked my code and am pretty confident that the code itself is correct.  i even tried loading the project in eclipse and it has the same problems, I think i will just rewatch the whole tutorial and will give an update on the situation.
    • same error, I also tried removing Valkyrian skies as well because I noticed it coming up a lot in the debug log errors
    • Hey man,    i have only been modding Minecraft for a few days but maybe I can help you. First of all make sure to follow every step of Kaupenjoe's tutorial, I found it to been very helpful and complete. The game uses the raw translation key for the item (in your case "item.testmod.alexandrite") if it can't find the correct lang file. Make sure it's name is "en_us.json" and it is saved under "ressources" -> "assets" -> "testmod".
    • whenever I try to get this item to render into the game it appears with the not texture purple and black squares and calls itself by the lang translation file path instead of the name i gave it.   { "item.testmod.alexandrite": "Alexandrite" } this is the lang json file package net.Hurst.testmod.item; import net.Hurst.testmod.TestMod; import net.minecraft.world.item.Item; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; public class ModItems { public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, TestMod.MOD_ID); public static final RegistryObject<Item> ALEXANDRITE = ITEMS.register("alexandrite", () -> new Item(new Item.Properties())); public static void register(IEventBus eventBus){ ITEMS.register(eventBus); } } this is my ModItems.java file package net.Hurst.testmod; import com.mojang.logging.LogUtils; import net.Hurst.testmod.item.ModItems; import net.minecraft.world.item.CreativeModeTabs; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.BuildCreativeModeTabContentsEvent; import net.minecraftforge.event.server.ServerStartingEvent; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.slf4j.Logger; // The value here should match an entry in the META-INF/mods.toml file @Mod(TestMod.MOD_ID) public class TestMod { public static final String MOD_ID = "testmod"; private static final Logger LOGGER = LogUtils.getLogger(); public TestMod() { IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); modEventBus.addListener(this::commonSetup); ModItems.register(modEventBus); MinecraftForge.EVENT_BUS.register(this); modEventBus.addListener(this::addCreative); ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.SPEC); } private void commonSetup(final FMLCommonSetupEvent event) { } // Add the example block item to the building blocks tab private void addCreative(BuildCreativeModeTabContentsEvent event) { if(event.getTabKey() == CreativeModeTabs.INGREDIENTS){ event.accept(ModItems.ALEXANDRITE); } } // You can use SubscribeEvent and let the Event Bus discover methods to call @SubscribeEvent public void onServerStarting(ServerStartingEvent event) { } // You can use EventBusSubscriber to automatically register all static methods in the class annotated with @SubscribeEvent @Mod.EventBusSubscriber(modid = MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public static class ClientModEvents { @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { } } } this is my TestMod.java file { "parent": "minecraft:item/generated", "textures": { "layer0": "testmod:item/generated" } } this is my model file for the item. I am using intellij 2025.1.2 with fdk 1.21 and java 21 I would appreciate the help.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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