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

Added Environment#isCraftBukkit #49

Closed PeachesMLG closed 3 years ago

PeachesMLG commented 3 years ago

Added support for Environment#isCraftBukkit

HexedHero commented 3 years ago

Can be useful to not enable the plugin

TheBusyBiscuit commented 3 years ago

Can be useful to not enable the plugin

SpigotEnvironment and PaperEnvironment are both extensions of CraftBukkitEnvironment though. So this will always return true in any Bukkit-based Server environment, including Spigot, Paper or any fork of them.

electronicboy commented 3 years ago

CB is the lowest common denominator in all of the stuff this lib supports, so that might as well (don't) just be a singular "return true" and that be that, I don't think that this actually adds anything, maybe if there was some platform we intended to support outside of this ecosystem, but, we don't.

Thanks for the PR, but, at this point, I don't really see what this serves to add

PeachesMLG commented 3 years ago

Can be useful to not enable the plugin

Lmao this is litrally what ill be using this for

O shit they do extend aswell, Guess ill have to find another way to do that, enjoy the useless pr

Prof-Bloodstone commented 3 years ago

You should do it the other way round - since your plugin requires AT LEAST Spigot, check if isSpigot() returns false - then don't enable :)