Jump to content

Recommended Posts

Posted

This is a small guide for people how want to Speed up their development by swapping changed code during run time, which eliminates the need to constantly restart the Minecraft-Client.

 

To reach our goal we need to install Hotswap and DCEVM.

 

To install DCEVM you first need to download the newest release for java 8 form this link:

https://github.com/dcevm/dcevm/releases

 

Before you continue installing DCEVM you need to first install the right java version that matches your download. Most likely this will be the version 1.8.0_181.

The download list can be found here:

https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html

 

To now install DCEVM run java -jar "path_to_the_installer/DCEVM-8u181-installer.jar" as Administrator in your console.

 

In the UI that pops up you need to select the java version you just installed and click on Install DCEVM as altjvm. You probably need to do this for the jdk and jre.

 

Next download the hotswap-agent and place the jar file in an appropriate folder.

https://github.com/HotswapProjects/HotswapAgent/releases

 

 

Now the Basic setup is finished, our next step is too setup Intellij and gradle two run correctly.

 

First thing you need to do is to install the HotswapAgent plugin for Intellij.

Plugins can be install under: Settings -> Plugins -> Marketplace

Search for hotswapagent.

 

Now under Tools -> HotswapAgent select Enable HotswapAgent in all configurations

 

Under Keymap search for "Reload Changed Classes" and assign a Keyboard shortcut.

 

Now press double shift and search for "Registry..."

and enable compiler.automake.allow.when.app.running

 

Finally to run the Minecraft client create a new gradle configuration 

with task = "runClient"

and VM options = "-Xmx3G
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5010
-XXaltjvm=dcevm
-XX:+UnlockExperimentalVMOptions
-javaagent:path_to_your\hotswap-agent-1.4.0.jar"

 

Now your good to go.

If you have any questions or suggestions feel free to comment below this is my first tutorial so 

if you have any advise it would be more than welocome.

I hope this is helpful for you have a nice Day.

 

 

  • Thanks 3
  • 4 weeks later...
Posted

Thanks for the how-to. Took a while to get it working even when reading this. I don't know if I would have had the patience to figure it out without it. XD Just a few notes.

 

1. You need to press 'Ok' on Intellij to apply changes to plugins. I definitely didn't spend 20 minutes trying to figure this out.

2. The vm option doesn't seem to be needed. The hot swap plugin didn't seem needed either. Was able to hotswap without both, but DCEVM needs to be installed.

3. Under Build the 'Build Project' and 'Recompile' option (and their shortcuts) works just fine, so no need to remap keys.

4. Everything other than installing DCEVM is unnecessary.

Posted

Hey TheZombie1999, thanks for the guide but I'm really new to modding and I've just setup my development environment yesterday for the first time and I really need to be able to hotswap, it's really slowing me down to restart minecraft over and over again..

 

But I couldn't work this out, then I saw ZDoctor's comment then start over from scratch, removed everything I've installed and just installed DCVEM for java jdk 1.8.0_181 and jre 1.8.0_181. It is now installed but what's next? I should have to do something in order hotswap to work right? Something is missing and I don't know what to do. Even if It's correct I don't know how to hotswap either, I mean when I run the client if I make any changes how can I hotswap? Nothing happens when I click rebuild.

 

Sorry if this is a very dumb question but as I've said I'm pretty new to these things.

 

I've attached my runClient config.

 

Screenshot_14.png

  • 1 month later...
Posted
On 4/22/2020 at 12:55 PM, RepubliCity said:

Hey TheZombie1999, thanks for the guide but I'm really new to modding and I've just setup my development environment yesterday for the first time and I really need to be able to hotswap, it's really slowing me down to restart minecraft over and over again..

 

But I couldn't work this out, then I saw ZDoctor's comment then start over from scratch, removed everything I've installed and just installed DCVEM for java jdk 1.8.0_181 and jre 1.8.0_181. It is now installed but what's next? I should have to do something in order hotswap to work right? Something is missing and I don't know what to do. Even if It's correct I don't know how to hotswap either, I mean when I run the client if I make any changes how can I hotswap? Nothing happens when I click rebuild.

 

Sorry if this is a very dumb question but as I've said I'm pretty new to these things.

 

I've attached my runClient config.

 

Screenshot_14.png

 

same nothing happened :(

  • 2 weeks later...
Posted

Hi, I'm current dcevm8/11 maintainer and my son is keen Minecraft player. Is the java8 edition still relevant for Minecraft developers? I can port G1 garbage collector with some hotswap performance optimizations from java11(dcevm11) to java8(dcevm8), if the community is interested in.

 

Btw, current dcevm11 is at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm , optimized with another new features at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm-staged

  • 4 weeks later...
Posted (edited)
On 6/26/2020 at 4:07 PM, skybber said:

Hi, I'm current dcevm8/11 maintainer and my son is keen Minecraft player. Is the java8 edition still relevant for Minecraft developers? I can port G1 garbage collector with some hotswap performance optimizations from java11(dcevm11) to java8(dcevm8), if the community is interested in.

 

Btw, current dcevm11 is at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm , optimized with another new features at https://github.com/TravaOpenJDK/trava-jdk-11-dcevm-staged

It's definitely still relevant for Minecraft mod development. I don't think Minecraft Forge officially supports anything newer than Java 8 yet.

Edited by EmberQuill
  • 2 months later...
Posted
On 4/22/2020 at 6:55 AM, RepubliCity said:

I mean when I run the client if I make any changes how can I hotswap? Nothing happens when I click rebuild.

Same thing for me... I've tried with both the hotswap plugin and without, and no changes occur. I've verified everything is setup correctly. Also not sure of the difference between "Recompile" under Build, and "Reload Changed Classes" under debug actions (I assume it makes no difference in debug mode?). Or if only certain changes are detected during runtime. 

  • 3 years later...

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

    • Also add the latest.log from /logs/
    • I was hoping I could get some help with this weird crash. I've hosted many servers before and never had this issue. Now and then the server crashed with "Exception ticking world". Everywhere I looked I rarely found any info on it (usually found ticking entity instead). Any advice I did get (mostly from the modpack owner's discord) was "We don't know and it's near impossible to find out what it is". Here is the crash report:   Description: Exception ticking world java.util.ConcurrentModificationException     at java.util.HashMap$HashIterator.nextNode(Unknown Source)     at java.util.HashMap$KeyIterator.next(Unknown Source)     at net.minecraft.entity.EntityTracker.sendLeashedEntitiesInChunk(EntityTracker.java:386)     at net.minecraft.server.management.PlayerChunkMapEntry.sendToPlayers(PlayerChunkMapEntry.java:162)     at net.minecraft.server.management.PlayerChunkMap.tick(SourceFile:165)     at net.minecraft.world.WorldServer.tick(WorldServer.java:227)     at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:756)     at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:397)     at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:668)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)     at java.lang.Thread.run(Unknown Source)   If you want the full version, I can link a pastebin if needed. Modpack link: https://www.curseforge.com/minecraft/modpacks/multiblock-madness Some helpful information is that: It seems to only happen when I leave my void world to enter the overworld. Only happens 5-10% of the time. Only happens when leaving the void world, and only the void world. I know it's a slim chance someone could help, but it'd be greatly appreciated.
    • thanks a lot bro i knew i shouldve gone on the actual website instead of the discord
    • Minecraft Version? Reinstall Java 17 and/or Java 21 If this is still not working, run jarfix https://johann.loefflmann.net/de/software/jarfix/index.html
    • Hallo liebes Forge team, mein forge installer nimmt nicht die Java datei an bzw. zeigt nicht das Symbol und öffnet immer nur kurz die console und schließt sich dann wieder.  Ich habe die neueste java datei und die neueste forge datei und es öffnet trotzdem nichts.  Könntet ihr mir dabei weiterhelfen?
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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