gecgooden / chunkgen

Mod to pre-generate chunks
MIT License
49 stars 17 forks source link

./gradlew runClient does not work #10

Closed Baughn closed 9 years ago

Baughn commented 9 years ago

In fact building it doesn't work at all. Fix the obvious code error, however, and you get a ConcurrentModificationException on startup.

Can you take a look?

gecgooden commented 9 years ago

I can't reproduce this.

What's the error you are fixing to cause this? EDIT: I assume the error you are talking about is the one in TickHandler calling Utilities.generateChunk. I've fixed that in my local copy (and about to commit) but I still can't reproduce the CME.

Baughn commented 9 years ago

It's possible that I "fixed" the build error the wrong way, by doing the obvious thing and removing the null, but.. here.

➜ chunkgen git:(master) ✗ ./gradlew runClient

The assetDir is deprecated!  I actually just did all this generalizing stuff just now.. Use runDir instead! runDir set to eclipse/assets/..
The runDir should be the location where you want MC to be run, usually he parent of the asset dir
****************************
 Powered By MCP:             
 http://modcoderpack.com/    
 Searge, ProfMobius, Fesh0r, 
 R4wk, ZeuX, IngisKahn, bspkrs
 MCP Data version : unknown
****************************
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
:processResources
:classes
:jar
:getVersionJson
:extractUserDev
:extractNatives
:getAssetsIndex
:getAssets
:makeStart SKIPPED
:runClient
[14:21:50] [main/INFO] [GradleStart]: Extra: []
[14:21:50] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, /home/svein/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
[14:21:50] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[14:21:50] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
[14:21:50] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
[14:21:50] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
[14:21:50] [main/INFO] [FML]: Forge Mod Loader version 7.10.18.1180 for Minecraft 1.7.10 loading
[14:21:50] [main/INFO] [FML]: Java is OpenJDK 64-Bit Server VM, version 1.8.0_45-internal, running on Linux:amd64:3.13.0-37-generic, installed at /usr/lib/jvm/java-8-openjdk-amd64/jre
[14:21:50] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
[14:21:50] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
[14:21:50] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
[14:21:50] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
[14:21:50] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[14:21:50] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[14:21:50] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
[14:21:50] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[14:21:50] [main/ERROR] [LaunchWrapper]: Unable to launch
java.util.ConcurrentModificationException
        at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901) ~[?:1.8.0_45-internal]
        at java.util.ArrayList$Itr.remove(ArrayList.java:865) ~[?:1.8.0_45-internal]
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:117) [launchwrapper-1.9.jar:?]
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]
        at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
        at GradleStart.main(Unknown Source) [start/:?]

BUILD SUCCESSFUL

Total time: 3.509 secs
Baughn commented 9 years ago

➜ chunkgen git:(master) ✗ git diff | cat

diff --git a/src/main/java/com/gecgooden/chunkgen/handlers/TickHandler.java b/src/main/java/com/gecgooden/chunkgen/handlers/TickHandler.java
index f475c86..34472d6 100644
--- a/src/main/java/com/gecgooden/chunkgen/handlers/TickHandler.java
+++ b/src/main/java/com/gecgooden/chunkgen/handlers/TickHandler.java
@@ -24,7 +24,7 @@ public class TickHandler {
                        for(int i = 0; i < Reference.numChunksPerTick; i++) {
                                ChunkPosition cp = Reference.toGenerate.poll();
                                if(cp != null) {
-                                       Utilities.generateChunk(null, cp.getX(), cp.getZ(), cp.getDimensionID());
+                                       Utilities.generateChunk(cp.getX(), cp.getZ(), cp.getDimensionID());
                                        float completedPercentage = 1 - (float)Reference.toGenerate.size()/(float)Reference.startingSize;
                                        if(tickCounter == Reference.tickDelay) {
                                                Reference.logger.info("percentage: " + completedPercentage);
gecgooden commented 9 years ago

The fix you made does look correct. I've pushed the fix into the repo. I was able to replicate the CME, but only when building in Java 1.8.0_51 on a Linux server (I'm using an older version on my mac). Updating the forge version seemed to solve it, so I've committed that too.

Try pulling and let me know how it goes.

Baughn commented 9 years ago

Works fine now. Your fix was the same as mine, so it's probably the Forge version.