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

How do I build for a specific version of minecraft? #4574

Open
2 tasks done
xiaodown opened this issue Nov 29, 2024 · 16 comments
Open
2 tasks done

How do I build for a specific version of minecraft? #4574

xiaodown opened this issue Nov 29, 2024 · 16 comments
Labels
question Further information is requested

Comments

@xiaodown
Copy link
Contributor

What do you need help with?

Hey Leijurv.

Current version works with 1.21.3 - but if I want to build for 1.21.1, how can I do that? (or somehow modify the build to force it to ignore the version restrictions)?

Final checklist

  • I know how to properly use check boxes
  • I have not used any OwO's or UwU's in this issue.
@xiaodown xiaodown added the question Further information is requested label Nov 29, 2024
@xiaodown
Copy link
Contributor Author

(I tried unpacking the jar and editing neoforge.mods.toml, then rezipping it, but that didn't work)

@PizzaGod873
Copy link

#4540

@ZacSharp
Copy link
Collaborator

There is a (unmaintained and slightly outdated) 1.20.1 branch you can build from. If you need more recent changes on 1.21.1 you'll need to look into the changes made when updating from 1.21.1 to 1.21.3 and revert them (locally).

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 1, 2024

Ok, yeah, there is actually a 1.21.1 branch (https://github.com/cabaletta/baritone/tree/1.21.1), and I've tried building it, but without much success - both using powershell and using an ubuntu VM. But I'm only a gradle novice, so ...maybe i'll try the other branch.

@PizzaGod873
Copy link

Ok, yeah, there is actually a 1.21.1 branch (https://github.com/cabaletta/baritone/tree/1.21.1), and I've tried building it, but without much success - both using powershell and using an ubuntu VM. But I'm only a gradle novice, so ...maybe i'll try the other branch.

Make sure you are using java 17

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 1, 2024

Gooooooood call, I've been trying with various versions of java. Is there a preference between oracle / openjdk?

@PizzaGod873
Copy link

Use adoptium, and get x64 jdk. If that doesn’t work I’ll send you a download link.

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 1, 2024

Sigh, I wish I understood what I'm doing wrong.

* What went wrong:
A problem occurred configuring project ':forge'.
> Failed to notify project evaluation listener.
   > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=21, vendor=any, implementation=vendor-specific} for LINUX on x86_64.
      > No locally installed toolchains match and toolchain download repositories have not been configured. 

that's very indicative of the problems I've been having. And I'm using the adoptium java 17:

 # java --version
openjdk 17.0.13 2024-10-15
OpenJDK Runtime Environment Temurin-17.0.13+11 (build 17.0.13+11)
OpenJDK 64-Bit Server VM Temurin-17.0.13+11 (build 17.0.13+11, mixed mode, sharing) 

(and this is a fresh ubuntu 22.04LTS vm I spun up just to compile this).

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 1, 2024

I got it to compile using temurin jdk21 but it crashes minecraft. Here was my process:

git clone https://github.com/cabaletta/baritone.git
apt-get update; apt-get dist-upgrade
apt-get install -y wget apt-transport-https gnupg
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | apt-key add -
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
apt-get update
apt-get install temurin-21-jdk
java --version
cd baritone/
git fetch; git switch 1.21.1
./gradlew build

That succeeds (fresh ubuntu 22.04) but the output jar doesn't work :(.

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 2, 2024

Build also succeeds for me with the 1.21 branch + temurin jdk21, and editing the neoforge meta to support 1.21.1, but still crashes blockgame :/. Sigh, I feel so dumb.

@PizzaGod873
Copy link

I’ll send the link when I’m home

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 2, 2024

Thank you so much, man. I apologize for being helpless. I wish I knew more and didn't have to bug kind strangers.

@PizzaGod873
Copy link

Oh you got it finished?

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 2, 2024

no, sorry. I am able to get the gradle build to work and output jars, using various branches and various versions of java, but every one i've managed to build crashes minecraft.

@xiaodown
Copy link
Contributor Author

xiaodown commented Dec 3, 2024

@PizzaGod873 If you do have a 1.21.1 jar that works, I'd really love a download link. Apologies for bugging you, but I have had no luck.

@ZacSharp
Copy link
Collaborator

ZacSharp commented Dec 5, 2024

You can also enable GitHub Actions on your repository and trigger the build workflow on the branch you want by pushing a dummy commit.

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

No branches or pull requests

3 participants