Closed drewdorris closed 6 years ago
I will take a look at it at end of July. I have to check backward compatibility.
Missed that, fixed
I have just take a deeper look. Why are you using getInstrumentName
in InstrumentUtils
? It will cost much more time to proceed. Also why are you using getFromBukkitName
and not the enum itself?
I was experiencing issues with using NoteBlockAPI with one version and another plugin that relies on the API with a different version -- the plugin would use getInstrument
to get the Sound enum for an instrument, but the enum would not exist in the shaded Bukkit API for the other plugin, instead being a version ahead. I added the getInstrumentName
method so that it would be possible to receive the name of a Sound enum without actually retrieving a potentially non-existent Sound enum. With that, I'm able to parse the name and retrieve the Sound enum for the other plugin. I found the method was needed for myself, and I imagine others may need it as well in certain situations. There shouldn't be any noticeable performance difference using getInstrumentName
in getInstrument
, as it only enters a short loop to retrieve the value, which should be virtually instant.
I used getFromBukkitName
in getInstrumentName
because the name of the enum in the local Sound class is not necessarily the latest updated name of the org.bukkit.Sound enum name, it's just one of the ones in the past. getFromBukkitName
retrieves the one relevant for the latest version
Added 1.13 support and refactored much of the project. Little of the core code was changed; instead, mainly appearance & usability was adjusted for easier usage of the API