TheGreyGhost / MinecraftByExample

Working sample code for the basic concepts in Minecraft and Forge.
Other
1.24k stars 187 forks source link

DistExecuter -> safeRunWhenOn #66

Closed Daveawb closed 3 years ago

Daveawb commented 3 years ago

I was playing around with your examples to get a grip on changes to forge (I'm coming from 1.8, a lot has changed!). I noticed you're using runWhenOn to bind client only events. Now I'm not entirely sure why it's deprecated yet but I imagined it was due to the lack of refferant checks the original method had. I'm not very keen on the DistExecuter in general, I've had a brief look at the code and it seems super hacky but with the lack of any other methods to check sidedness in 1.16.x I guess it's what we've got.

That said, I've updated your examples to use safeRunWhenOn if that's something you'd prefer to use.

TheGreyGhost commented 3 years ago

Howdy Thanks for the comment and pull request!

I'll have a look in the next few days when my IRL calms down a bit.. Cheers TGG

TheGreyGhost commented 3 years ago

I merged, tweaked the code a bit, tested. Looks good. Thanks for your help! Cheers TGG