AnOpenSauceDev / FastRandom

An optimized rewrite of Minecraft's RNG system, for Fabric!
Apache License 2.0
48 stars 3 forks source link

[BUG]: java security doesn't let this run but never warns or gives a crash. #40

Closed davidromrell closed 6 months ago

davidromrell commented 6 months ago

Does an issue already cover this?

Does your system support Faster Random?

Issue description.

I am using a secure java environment so it does not let this work fully although gives no crash or bug just lag, what would you recommend.

Issue replication.

on startup JDK 21 with game startup java 17

mod version is 3.03

Log File / Crash Report (if applicable)

No response

AnOpenSauceDev commented 6 months ago

I'm not exactly sure by what you mean when you say "java security", and I don't see how it could break Faster Random since it doesn't import anything external except for MixinExtras. I'm going to need more information about your Java setup so I actually understand what's going on here.

davidromrell commented 6 months ago

jdk-21.0.2.13 is my java base version, it has had an issue where it says corrupted or invalid jar file, yet it runs all the other mods fine. Unsure what else to add.

AnOpenSauceDev commented 6 months ago

Maybe Corretto doesn't support RandomGenerator and tries to preload the class, breaking the mod. Try using GraalVM.

davidromrell commented 6 months ago

I will try fixing this in about a week, let me know if you find a solution before than. Thanks for your time.

davidromrell commented 6 months ago

I tested and it ran with GraalVM.

davidromrell commented 6 months ago

Could you show where the learning happened that caused this incredible mod? I would like to learn.

AnOpenSauceDev commented 6 months ago

Could you show where the learning happened that caused this incredible mod? I would like to learn.

At a basic level, it's nothing complex, originally this mod just hijacked the MathHelper random methods and essentially replaced them with calls to ThreadLocalRandom, as it was faster than the CheckedRandom implementation. Over time I extended this to some entity operations, and nowadays the Random interface itself has been re-implemented with a much faster random generator (LXM) that comes built in with a handful of JDK's (unfortunately quite a few do not contain these generators).