Unable to compile source code using gradlew.bat- error listed below #21

Open
opened 2021-01-04 04:16:03 +01:00 by luxidoptera · 3 comments

Neither me nor a friend are able to compile the source code of this mod (modified or unmodified) due to an error, seemingly rooting back to the world generation files. Error dump below (simplified, as neither of us could figure out how to produce the verbose output).

> Task :compileJava
C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\sosnitzka\taiga\world\WorldGen.java:21: error: duplicate class: com.sosnitzka.taiga.world.WorldGen
public class WorldGen implements IWorldGenerator {
       ^
C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:130: error: incompatible types: EnumType cannot be converted to IBlockState
        Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world,
                                                                                ^
C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:132: error: incompatible types: EnumType cannot be converted to IBlockState
        Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z,
                                                                                 ^
C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:136: error: incompatible types: EnumType cannot be converted to IBlockState
        Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
                                                                                ^
C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:138: error: incompatible types: EnumType cannot be converted to IBlockState
        Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
                                                                                  ^
C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:140: error: incompatible types: EnumType cannot be converted to IBlockState
        Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z,
                                                                                ^
C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:157: error: non-static method getAllowNether() cannot be referenced from a static context
                if(!net.minecraft.server.MinecraftServer.getAllowNether()) {
                                                        ^
Note: C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\util\StateMatcher.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
7 errors
Neither me nor a friend are able to compile the source code of this mod (modified or unmodified) due to an error, seemingly rooting back to the world generation files. Error dump below (simplified, as neither of us could figure out how to produce the verbose output). ``` > Task :compileJava C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\sosnitzka\taiga\world\WorldGen.java:21: error: duplicate class: com.sosnitzka.taiga.world.WorldGen public class WorldGen implements IWorldGenerator { ^ C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:130: error: incompatible types: EnumType cannot be converted to IBlockState Generator.generateOre(auroriumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, ^ C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:132: error: incompatible types: EnumType cannot be converted to IBlockState Generator.generateOre(palladiumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, ^ C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:136: error: incompatible types: EnumType cannot be converted to IBlockState Generator.generateOre(tiberiumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, ^ C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:138: error: incompatible types: EnumType cannot be converted to IBlockState Generator.generateOre(prometheumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, ^ C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:140: error: incompatible types: EnumType cannot be converted to IBlockState Generator.generateOre(valyriumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, ^ C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\world\WorldGen.java:157: error: non-static method getAllowNether() cannot be referenced from a static context if(!net.minecraft.server.MinecraftServer.getAllowNether()) { ^ Note: C:\Users\Sylvie\Documents\TAIGA unmodified code, for testing\taiga\build\sources\main\java\com\sosnitzka\taiga\util\StateMatcher.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 7 errors ```
Author

Update: Deleting main\java\sosnitzka... fixes the duplicate error, but all other errors are still present. It's still not possible to compile the source.

Update: Deleting main\java\sosnitzka\... fixes the duplicate error, but all other errors are still present. It's still not possible to compile the source.
Author

Another update: These issues, aside from the duplicate world gen file, all link down to the code allowing Nether ores to generate in the overworld if the Nether is disabled. Removing the worldNetherless code allows the mod to compile. Please look into the way this is implemented.

Another update: These issues, aside from the duplicate world gen file, *all* link down to the code allowing Nether ores to generate in the overworld if the Nether is disabled. Removing the worldNetherless code allows the mod to compile. Please look into the way this is implemented.
Contributor

The way it was implemented supposedly worked before, but I see it doesn't like it now. I don't yet know enough about static vs. non-static variable permissions in java, but probably instead of calling the method net.minecraft.server.MinecraftServer.getAllowNether() directly in the if(), doing it as a variable (like netherAllowed=net.minecraft.server.MinecraftServer.getAllowNether() ) that updates when the map initially loads (shouldn't be able to change the allow-nether option when the server is running) might get it dusted off and working.

So, To Do:

public integer (or whatever the vanilla var is) netherAllowed;

//Implement where the map is initially loaded
netherAllowed=net.minecraft.server.MinecraftServer.getAllowNether();

and change the line

if(!net.minecraft.server.MinecraftServer.getAllowNether()) to if(!netherAllowed)

Then there's the blockEnum / IBlockState problem, that might be from changes going forward to 1.16? I don't know.

Essentially the netherless ore code is more or less a copy/amalgamation of the nether ore code and the overworld ore code as a reference. Changes made to the overworld ore programming have to be mirrored on the netherless ore programming.

The way it was implemented supposedly worked before, but I see it doesn't like it now. I don't yet know enough about static vs. non-static variable permissions in java, but probably instead of calling the method net.minecraft.server.MinecraftServer.getAllowNether() directly in the if(), doing it as a variable (like netherAllowed=net.minecraft.server.MinecraftServer.getAllowNether() ) that updates when the map initially loads (shouldn't be able to change the allow-nether option when the server is running) might get it dusted off and working. So, To Do: public integer (or whatever the vanilla var is) netherAllowed; //Implement where the map is initially loaded netherAllowed=net.minecraft.server.MinecraftServer.getAllowNether(); and change the line if(!net.minecraft.server.MinecraftServer.getAllowNether()) to if(!netherAllowed) Then there's the blockEnum / IBlockState problem, that might be from changes going forward to 1.16? I don't know. Essentially the netherless ore code is more or less a copy/amalgamation of the nether ore code and the overworld ore code as a reference. Changes made to the overworld ore programming have to be mirrored on the netherless ore programming.
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TAIGA/TAIGA#21
No description provided.