StoneLabs / working-graves

They are graves. They work. Fabricmc mod.
5 stars 3 forks source link

Add singleplayer support #5

Closed SanityCh3ck closed 1 year ago

SanityCh3ck commented 1 year ago

This change makes the mod work in singleplayer, while keeping it optional in multiplayer environments.

StoneLabs commented 1 year ago

Looks good, well done.

Did you test to see if everything is working alright if the client has the mod installed on a vanilla server?

If so, I'll be happy to merge. Also please feel free to add yourself here for proper credit.

SanityCh3ck commented 1 year ago

Does the mixin not cause any issues?

Not that I could tell. My (limited) understanding is that ServerPlayerEntities don't exist on clients in multiplayer, so it shouldn't be a problem.

Looks like the command and useblock event are still being registered if we are a multiplayer client

The command registration is called whenever an integrated or dedicated server starts. The useBlock event is registered but does nothing on multiplayer clients due to the ServerWorld check.

Environments I've tested:

SanityCh3ck commented 1 year ago

Thank you for wanting to credit me. Frankly, I'd prefer not to have an e-mail attached to that. Until yesterday I wasn't even aware that it was already attached to my commits, though unfortunately changing it retroactively would be a massive pain.