Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Using Intellij IDEA for Mod-Development with ForgeGradle


Recommended Posts

  • 4 weeks later...
  • Replies 132
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Note (Sep. 2017): This post is now getting very old, but it still applies. Regardless you might want to refer to the IntelliJ section in the official Getting Started guide instead.   In this

Thanks, now it works and I created my very first mod which does absolutely nothing at all :-)

Can we get this posted as a sticky?!?! For something that's mentioned in passing, it's pretty damn important for new modders. It took me two days of searching and trying out different things to figure

So, while trying to do this for my own development setup (prefering IntelliJ over Eclipse) when importing the mod IntelliJ responds 'The target server failed to respond'. I am using IntelliJ version 15.0.4

 

EDIT: So, either the problem was using import instead of open, or it was my internet connection...

Link to post
Share on other sites

Okay, I've tried "gradlew --refresh-dependencies" "gradlew clean" and then run the setup again, I've tried doing the invalidate and restart option, and I can't figure out what I've done wrong. Minecraft does not compile or run.

 

 

It doesn't use imports and can't resolve things, and it says "Class 'Main' is never used".

 

Did I do setup wrong or something?

 

 

Link to post
Share on other sites

I'm trying to get the MDK to working IntelliJ but are hitting some problems. Would appreciate some help.

 

When I try to import the build.grade file into IntelliJ I get the message "Cannot import, Cannot import anything from /path/to/build.gradle". I tried it in a couple of different ways, selecting import from the IntelliJ start screen and also selecting File > New > Project From Existing sources... IntelliJ will just directly give me the message without any dialogs. All I get is the message and an OK button.

 

EDIT:

 

I have tried with both IntelliJ 14 Community Edition and IntelliJ 15 CE.

 

EDIT2:

 

Never mind, I found the reason :-). I originally setup IntelliJ for use with Clojure so I did not include all the tools and plug-ins. So the gradle plugin was not installed. I cleaned out all settings for IntelliJ, restarted and selected all tools and plug-ins and now it can open the gradle.build file!

Link to post
Share on other sites

For some reason lately on any version of forge, I get everything set up but when I run the game on either server or client, I get this error:

 

"C:\Program Files\Java\jdk1.8.0_73\bin\java" -Didea.launcher.port=7532 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_73\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_73\jre\lib\rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.1\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain GradleStart
Exception in thread "main" java.lang.ClassNotFoundException: GradleStart
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122)

Process finished with exit code 1

 

Also, the Client and Server tabs are Xed out. What does that mean?

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to post
Share on other sites
  • 4 weeks later...
  • 1 month later...

So, I followed your tutorial step by step, but got stuck in before launching the client from IntelliJ idea. As you suggested, I opened cmd in folder with forge and run gradlew setupDecompWorkspace --refresh-dependencies

 

This unfortunatelly end up stuck at 91 percent, and build failed. I was able to find out that one of the addresses requested timed-out (when I tried it in the browser, it loaded okay, it's this one: https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom), and then I found out, that the other address returns forbidden - which is most likely obstacle that my current installation won't overcome, it's this one: https://libraries.minecraft.net/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom).

 

Do you have any thoughts on how to fix this? Thanks in advance for any help provided.

Link to post
Share on other sites

So, I followed your tutorial step by step, but got stuck in before launching the client from IntelliJ idea. As you suggested, I opened cmd in folder with forge and run gradlew setupDecompWorkspace --refresh-dependencies

 

This unfortunatelly end up stuck at 91 percent, and build failed. I was able to find out that one of the addresses requested timed-out (when I tried it in the browser, it loaded okay, it's this one: https://repo1.maven.org/maven2/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom), and then I found out, that the other address returns forbidden - which is most likely obstacle that my current installation won't overcome, it's this one: https://libraries.minecraft.net/org/ow2/asm/asm-debug-all/5.0.3/asm-debug-all-5.0.3.pom).

 

Do you have any thoughts on how to fix this? Thanks in advance for any help provided.

Link to post
Share on other sites

It shouldn't try to load them from Mojang's server... Not sure why it does.

 

Man, I really appreciate your fast reply. Have not seen that one coming. I run the gradlew command few more times, hit control + c few times to interrupt it, when I got the impression it crashed and then, finally run it again in Idea and it SOMEHOW started working. Don't know, why... it does not load the *.pom file from mojang server now. It works though. Thank.

Link to post
Share on other sites

It shouldn't try to load them from Mojang's server... Not sure why it does.

 

Man, I really appreciate your fast reply. Have not seen that one coming. I run the gradlew command few more times, hit control + c few times to interrupt it, when I got the impression it crashed and then, finally run it again in Idea and it SOMEHOW started working. Don't know, why... it does not load the *.pom file from mojang server now. It works though. Thank.

Link to post
Share on other sites

Usually, this kind of problem happens when you have network problems. If the dependency is not available or reachable in the default location, it tries _all repos_ - that's why you see gradle trying to hit mojang's server.

just you wait! ;)

Link to post
Share on other sites

Usually, this kind of problem happens when you have network problems. If the dependency is not available or reachable in the default location, it tries _all repos_ - that's why you see gradle trying to hit mojang's server.

just you wait! ;)

Link to post
Share on other sites
  • 3 months later...

I'm looking for hints on the best practices for mod development.

 

Here's the question:

 

In the minds of Forge developers when they consider making a new mod, are the best practices to use Gradle over Maven as the overall framework for the mod build environment? 

 

What does one offer over the other to make developing a mod easier or more smooth in the context of Minecraft Forge (1.10.2 or later)?

 

Thanks.

 

 

Link to post
Share on other sites

I'm looking for hints on the best practices for mod development.

 

Here's the question:

 

In the minds of Forge developers when they consider making a new mod, are the best practices to use Gradle over Maven as the overall framework for the mod build environment? 

 

What does one offer over the other to make developing a mod easier or more smooth in the context of Minecraft Forge (1.10.2 or later)?

 

Thanks.

 

Forge's official build system is ForgeGradle (a Gradle plugin). This sets up everything you need to develop a mod and handles the reobfuscation process when building the mod.

 

To use Maven, you'd have to re-implement all this yourself or find a way to integrate with ForgeGradle.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.




  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Try to swich versions of the game, if that dest work try to install the game again.
    • Hello There! Yes I know it's been a while and there are reasons that I explain in this video! But in this video talk about some pretty cool updates and announcements to the channel that I am super excited to share with you guys! Also yes this was filmed on the Hive about a day before it shut down! I hope you all enjoy this video and if you did don't forget to like and sub for more!  
    • Hi, I'm trying to create an entity based of a minecart but the entity appears to be invisible and unable to be interacted with. I'm not seeing any errors in the debug log. I have included my entity and renderer. I have not added any attributes to this entity as I don't think there is any way to add them to minecarts. I added a message during ticks that appears when its alive but the minecart itself does not. public class TrainEntity extends AbstractMinecartEntity { public TrainEntity(EntityType<?> p_i50126_1_, World p_i50126_2_) { super(p_i50126_1_, p_i50126_2_); } public TrainEntity(World p_i1723_1_, double p_i1723_2_, double p_i1723_4_, double p_i1723_6_) { super(EntityRegister.TRAINENTITY.get(), p_i1723_1_, p_i1723_2_, p_i1723_4_, p_i1723_6_); } public static final String REG = "train_entity"; @Override public Type getMinecartType() { return AbstractMinecartEntity.Type.RIDEABLE; } public ActionResultType interact(PlayerEntity p_184230_1_, Hand p_184230_2_) { ActionResultType ret = super.interact(p_184230_1_, p_184230_2_); if (ret.consumesAction()) return ret; if (p_184230_1_.isSecondaryUseActive()) { return ActionResultType.PASS; } else if (this.isVehicle()) { return ActionResultType.PASS; } else if (!this.level.isClientSide) { return p_184230_1_.startRiding(this) ? ActionResultType.CONSUME : ActionResultType.PASS; } else { return ActionResultType.SUCCESS; } } @Override public void tick() { super.tick(); STAR.LOGGER.debug("STAR - Training Hard"); } public class TrainEntityRender<T extends TrainEntity> extends EntityRenderer<T> { protected final EntityModel<T> model = new CreeperModel<>(); public TrainEntityRender(EntityRendererManager p_i46155_1_) { super(p_i46155_1_); this.shadowRadius = 0.7F; } @Override public ResourceLocation getTextureLocation(TrainEntity p_110775_1_) { return new ResourceLocation(STAR.MODID, "textures/entity/purple_thing.png"); } @Override public void render(T p_225623_1_, float p_225623_2_, float p_225623_3_, MatrixStack p_225623_4_, IRenderTypeBuffer p_225623_5_, int p_225623_6_) { super.render(p_225623_1_, p_225623_2_, p_225623_3_, p_225623_4_, p_225623_5_, p_225623_6_); //Bunch of other stuff copied from the MinecartRenderer p_225623_4_.scale(-1.0F, -1.0F, 1.0F); this.model.setupAnim(p_225623_1_, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F); IVertexBuilder ivertexbuilder = p_225623_5_.getBuffer(this.model.renderType(this.getTextureLocation(p_225623_1_))); this.model.renderToBuffer(p_225623_4_, ivertexbuilder, p_225623_6_, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); p_225623_4_.popPose(); STAR.LOGGER.debug("STAR - RENDER"); } protected void renderMinecartContents(T p_225630_1_, float p_225630_2_, BlockState p_225630_3_, MatrixStack p_225630_4_, IRenderTypeBuffer p_225630_5_, int p_225630_6_) { Minecraft.getInstance().getBlockRenderer().renderSingleBlock(p_225630_3_, p_225630_4_, p_225630_5_, p_225630_6_, OverlayTexture.NO_OVERLAY); } } Event Register: @SubscribeEvent public static void onClientSetupEvent(FMLClientSetupEvent event) { LOGGER.info("STAR - Client Setup"); //Other renderers RenderingRegistry.registerEntityRenderingHandler(EntityRegister.TRAINENTITY.get(), TrainEntityRender::new); } Any help would be greatly appreciated. 
    • I used diesieben07 suggestion and got it all working. I have included my completed entity for anyone who needs it. Entity Class: public class TestEntity extends CowEntity { public static final String REG = "simple_entity"; public TestEntity(EntityType<? extends CowEntity> p_i48567_1_, World p_i48567_2_) { super(p_i48567_1_, p_i48567_2_); STAR.LOGGER.debug("STAR - Entity Constructed"); } public static AttributeModifierMap.MutableAttribute createAttributes() { return MobEntity.createMobAttributes().add(Attributes.MAX_HEALTH, 0.5D) .add(Attributes.MOVEMENT_SPEED, (double)0.2F) .add(Attributes.FOLLOW_RANGE, 20.0) .add(Attributes.ATTACK_DAMAGE, 20.0); } @Override protected void registerGoals() { STAR.LOGGER.debug("STAR - Entity Goals"); this.goalSelector.addGoal(0, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT), false)); } } Entity register: public class EntityRegister { public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, STAR.MODID); public static final RegistryObject<EntityType<TestEntity>> TESTENTITY = ENTITIES.register(TestEntity.REG, () -> EntityType.Builder.<TestEntity>of(TestEntity::new, EntityClassification.MISC) .sized(0.98F, 0.7F) .clientTrackingRange(8) .build(TestEntity.REG)); } Thanks for all your help.
    • Ha, lol, I got confused between galloping and sprinting. Turns out horses gallop not sprint. Anyway I just override the gallop method instead and it works a treat.  Thanks for your help
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.