Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.20.4 #84

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

1.20.4 #84

wants to merge 1 commit into from

Conversation

AnAverageBeing
Copy link

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.

@M3RGeo
Copy link

M3RGeo commented Mar 1, 2024

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

@crpmax
Copy link
Owner

crpmax commented Mar 2, 2024

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.

@M3RGeo
Copy link

M3RGeo commented Mar 2, 2024

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.

@AnAverageBeing
Copy link
Author

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.

@IkdanYT
Copy link

IkdanYT commented Mar 6, 2024

pls add

@polyzium
Copy link

+1 to this, Minecraft 1.20.4 requires Java 17 at this point, so it is most likely that the user will have Java 17 installed on their system. I have a 1.20.4 Paper server and I would like to test the plugin with this software.

@polyzium
Copy link

polyzium commented May 20, 2024

After changing sourceCompatibility and targetCompatibility to 17, it does compile and run, but the bots time out before joining the game. whenever I try to send a chat msg I get this:
io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: Unregistered serverbound packet class: com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChatCommandPacket

EDIT: Nevermind, my server has a custom resource pack, that's what caused the hanging on connection

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants