mc-bots icon indicating copy to clipboard operation
mc-bots copied to clipboard

1.20.4

Open AnAverageBeing opened this issue 4 months ago • 7 comments

updated mcprotocollib to 1.20.4-2-SNAPSHOT added net.kyori:adventure-text-serializer-gson:4.16.0 as dependency because when building without it it gave error because the version that mcprotcollib used was not available.

AnAverageBeing avatar Feb 25 '24 07:02 AnAverageBeing

have you been able to successfully compile it ? Because I keep running into errors trying to compile this pr, it has to do with the java version.

this is what i get ****\mc-bots\src\main\java\me\creepermaxcz\mcbots\Bot.java:5: error: cannot access com.github.steveice10.mc.protocol.MinecraftConstants import com.github.steveice10.mc.protocol.MinecraftConstants; ^ bad class file: ****\.gradle\caches\modules-2\files-2.1\com.github.steveice10\mcprotocollib\1.20.4-2-SNAPSHOT\33b5a925f7a96447a2be9dad89f16b94ab6a4134\mcprotocollib-1.20.4-2-SNAPSHOT.jar(com/github/steveice10/mc/protocol/MinecraftConstants.class) class file has wrong version 61.0, should be 52.0 Please remove or make sure it appears in the correct subdirectory of the classpath.

it seems that mcprotocollib to 1.20.4-2-SNAPSHOT requires java 17 when the rest of this project uses java 8 to compile, I don't know how to set gradle to fix the issue, I think you have to change the following settings in build.gradle

from: sourceCompatibility = 1.8 targetCompatibility = 1.8

To: sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17

or just '17' at each, the last one worked for me after I found a issue with my java_Home path... ^^ This helps but it still won't compile

M3RGeo avatar Mar 01 '24 14:03 M3RGeo

Yes, it seems like Java 17 is required. I have managed to compile it using gradle build, but when I run it with Java 8 it will not connect and fail with Exception in thread "main" java.lang.UnsupportedClassVersionError: com/github/steveice10/packetlib/packet/PacketProtocol has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I will look into it and maybye upgrade it to Java 17 if there is no other solution.

crpmax avatar Mar 02 '24 09:03 crpmax

i was able to compile it yesterday and get it to run with no issue, but had to do both with java 17, java 8 doesn't want to work with it, the main reason I found for the major change with that is that the new mcprotocollib has a class that's written exclusively in java 17.

M3RGeo avatar Mar 02 '24 10:03 M3RGeo

yes like most modern minecraft related tools and libraries require java 17. Like maybe just use java 17. java 8 is too old at this point.

AnAverageBeing avatar Mar 02 '24 13:03 AnAverageBeing

pls add

IkdanYT avatar Mar 06 '24 14:03 IkdanYT