[SPIGOT-6388] Shulker.getPeek() function Created: 05/Mar/21 Updated: 28/Apr/21 Resolved: 19/Apr/21 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Evil Witchdoctor | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Version: | bukkit-1.16-R1 and/or spigot-api-1.16-R1 |
Guidelines Read: | Yes |
Description |
It would be nice to be able to get the state of a Shulker entity without NMS/reflection: shulker.isClosed() -> boolean Context: |
Comments |
Comment by Evil Witchdoctor [ 15/Apr/21 ] |
Awesome, thanks! |
Comment by Julian v.d Berkmortel [ 14/Apr/21 ] |
I created a pull request implementing both the API and implementation. Bukkit: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/599 |
Comment by Baciu Vlad Robert [ 14/Apr/21 ] |
I agree that we should use an enum for this. The name of the enum itself could be ShulkerState while its constants could be CLOSED, PEEKING, OPEN. |
Comment by Julian v.d Berkmortel [ 13/Apr/21 ] |
"Peek" is an NBT tag which can be 0 (closed), 30 (partially open) or 100 (completely open with rotating shell). I've tested it with numbers like 20, 150, 101, 200 et cetera but it seems that they result in either the shulker being partially or completely open. I'd like to work on this but before I do it would be good to have the API outlined. I'd argue for an enum because there are only three numbers that have a real "meaning" in regards to the animation, I don't exactly know what the name of them should be and the name of the enum itself (if an enum would be decided upon). |