Closed altrisi closed 3 years ago
Would make a PR, but there is no license specified.
The changes have been pushed to fabric-carpet
. This will be an issue in the next release if not fixed, without giving any useful feedback to the user (except if extra checks are added to fabric-carpet, which I don't think will happen).
And it's as easy to fix as wrapping the above code into if (source != null) { ... }
I just made a commit, so i think this issue can be closed now. Im gonna wait for your confirmation @altrisi and then make a release
Seems to be fixed in last commit, thanks!
In fabric-carpet, rules are synced with clients. That sync behaviour happens when the player joins and when someone changes a rule in-game. ~The syncing behaviour is currently broken for extension's custom
SettingsManagers
(see gnembon/fabric-carpet#546), which is why this issue hasn't really occurred (yet).~ The changes have been pushed to carpet.However, I'm currently fixing that issue, and I've encountered this problem while testing (that took me hours to realize it wasn't an issue in my code since minecraft doesn't print stacktraces from network by itself).
This NPE kicks/prevents players from joining servers with skyblock when having it in their client too.
Reason: When syncing, Carpet (client) will pass
null
as theServerCommandSource
to the rule. The rule will then call its set method to get parsed, since in the network it gets sent as a string, and will call its validators. ThebetterPotions
rule uses that source when being validated, and will assume that it isn't null, when in this case it will be.https://github.com/skyrising/skyblock/blob/501c19706dd338143e6e34638e4978e9ca2b698a/src/main/java/skyblock/SkyBlockSettings.java#L23-L28
Solutions: Check whether the source is
null
before using it inbetterPotions
or get it from a different place (since it would be in the client and you are searching for aMinecraftServer
, probably the first one).