CryptoMorin / XSeries

Library for cross-version Minecraft Bukkit support and various efficient API methods.
https://www.spigotmc.org/threads/378136/
MIT License
403 stars 126 forks source link

Added an "or" method in XMaterial #186

Closed SkytAsul closed 2 years ago

SkytAsul commented 2 years ago

XMaterial#or(XMaterial alternateMaterial) is an utility method that changes this syntax: XMaterial.NEW_MATERAL.isSupported() ? XMaterial.NEW_MATERIAL.parseMaterial() : XMaterial.ALTERNATE_OLD_MATERIAL.parseMaterial() to this: XMaterial.NEW_MATERIAL.or(XMaterial.ALTERNATE_OLD_MATERIAL.parseMaterial().

CryptoMorin commented 2 years ago

That looks super clean and simple. I like it