PaperMC / PaperLib

Plugin Library for interfacing with Paper Specific API's with graceful fallback that maintains Spigot Compatibility, such as Async Chunk Loading.
MIT License
267 stars 32 forks source link

Return false for isChunkGenerated with unknown API #58

Closed pop4959 closed 2 years ago

pop4959 commented 2 years ago

Extremely minor change/nitpick but isChunkGenerated should not return true when the API cannot be detected -- for example, in the brief duration that the paper version could not be detected correctly (due to the existence of release candidate builds). This is generally a bad assumption to make and can lead to unexpected behavior in plugins.

electronicboy commented 2 years ago

Issue with this is that you can argue for it both ways, saying that chunks are already generated seemed to be the lesser of two evils at the time iirc

pop4959 commented 2 years ago

Yeah I suppose that's true, I think I might have been a bit hasty to make this PR since this came to mind when looking at this repo again, after this issue having caused me some grief.

The better fix is clearly something like discussed in #53 (detect features rather than environment where possible). Not sure how it'd help much here though given that Spigot does have the same method... but I care about whether the implementation is provided by Paper as Spigot's does not always return accurately.

Can't think of a better solution right now but this one is clearly a bit too lazy, so I'll close for now.