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

The latest Twilight Forest jar seems to stop #mine from working on 1.21.1 #4526

Open
4 tasks done
ipaqmaster opened this issue Oct 19, 2024 · 7 comments
Open
4 tasks done
Labels
bug Something isn't working

Comments

@ipaqmaster
Copy link

Some information

Operating system: Linux 6.6.56-1-lts
Java version: jdk21-openjdk 21.0.5.u11-1
Minecraft version: 1.21.1 (Direwolf20 1.21 - v1.3.0)
Baritone version: Local build baritone-standalone-neoforge-1.10.2-8-g50291089.jar
Other mods (if used): Direwolf20 1.21 v1.3.0 so ~250 other mods.

Exception, error or logs

Please find your latest.log or debug.log in this folder and attach it to the issue

To be attached

Linux: ~/.minecraft/logs/

Windows: %appdata%/.minecraft/logs/

Mac: /Library/Application\ Support/minecraft/logs/

How to reproduce

Add your steps to reproduce the issue/bug experienced here.

  1. Drop baritone into the mods folder
  2. Launch and start a new world
  3. #mine someBlock
  4. Baritone almost immediately throws an exception in the logs

Try again after removing twilightforest-1.21.1-4.6.2790-universal.jar and it is able to #mine again with a bit of a game freeze before mining starts.

Modified settings

To get the modified settings run #modified in game

This is with a fresh installation of the pack, no modified settings.

Final checklist

  • I know how to properly use check boxes
  • I have included the version of Minecraft I'm running, baritone's version and forge mods (if used).
  • I have included logs, exceptions and / or steps to reproduce the issue.
  • I have not used any OwO's or UwU's in this issue.
@ipaqmaster ipaqmaster added the bug Something isn't working label Oct 19, 2024
@ipaqmaster
Copy link
Author

latest.log

@ipaqmaster
Copy link
Author

I can confirm that Baritone is still capable of responding with daniel when Damn is said in the chat despite this issue

@NicoBeh
Copy link

NicoBeh commented Nov 7, 2024

If I interpret the stack trace correctly this is an issue with the JSON metadata files of the twilight forest blocks. And somewhere along the parsing of these files an error gets raised. That in itself is fine for the indiviual block but the error won't get caught because it's not an exception. Java is not my forte so that explanation might be wrong.

Anyway, this is a quick and dirty fix which seems to work.

--- a/src/api/java/baritone/api/utils/BlockOptionalMeta.java
+++ b/src/api/java/baritone/api/utils/BlockOptionalMeta.java
@@ -242,7 +242,7 @@ public final class BlockOptionalMeta {
                         .withParameter(LootContextParams.BLOCK_STATE, b.defaultBlockState())
                         .withParameter(LootContextParams.TOOL, new ItemStack(Items.NETHERITE_PICKAXE, 1));
                     getDrops(block, lv5).stream().map(ItemStack::getItem).forEach(items::add);
-                } catch (Exception e) {
+                } catch (Throwable e) {
                     e.printStackTrace();
                 }
                 return items;

Not sure if this is 'good enough' to be merged into the project.

@ipaqmaster
Copy link
Author

I came to a similar conclusion but inspecting the culprit json extracted from twilight forest was fine. Perhaps there's still an error among one or more of the other json structures in that version.

@ipaqmaster
Copy link
Author

I extracted twilightforest's jar and enumerated each of its JSON files finding no problems.

There were some JSON files from this mod which had //comment lines inside which upset jq during the parsing stage. But removing them and repacking the file did not fix Baritone.

@rfresh2
Copy link
Contributor

rfresh2 commented Nov 9, 2024

the issue is not related to any json metadata files

its how baritone initializes server-side registries on the client-side. its (incorrectly) trying to load non-vanilla registry data.

resolved by #4553

this PR is for 1.20.5 but will be merged up to 1.21 eventually

if you want to test the changes on 1.21 before then you can grab the CI build from my fork: https://github.com/rfresh2/baritone/actions/runs/11754517133

@ipaqmaster
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants