Repository navigation
Conversation
Lulu13022002
left a comment
There was a problem hiding this comment.
Can you move the implementation to a common class like CraftSelectable or something.
PlayerInteractEvent#getClickedPosition should probably be renamed too but it can be done in another PR to not rely on a deprecated method.
Also next time don't show an image for your test code it's not convenient.
|
|
||
| @Override | ||
| public int getSlot(Vector clickVector) { | ||
| BlockFace facing = ((Directional) this.getBlockData()).getFacing(); |
There was a problem hiding this comment.
It's not safe to cast the block data cause a plugin could simply change it to something else.
There was a problem hiding this comment.
Well i base in the other implementation... Maybe a Precondition.checkState can be good here?
There was a problem hiding this comment.
A precondition is better -1 has some other meaning here, i did the change for you. But from a quick look it's impossible for this method to return -1?
There was a problem hiding this comment.
looks like but not sure.. i prefer keep that docs xd
Okay, for the common class just move all to a new class with static methods not? |
8967805 to
ff6432f
Compare
56e6983 to
a8b7863
Compare
a8b7863 to
62a4c2b
Compare
|
Rebased... looking the code the only way for get the -1 its a case where the block can has 0 rows and columns... and unless anybode mess with the server its not a expected behaviour for document like spigot does years ago... |
Close #13398 by adding a method for determinate the slot using a Vector, works like the same than the logic for ChiseledBookshelf
test:
javaw_2025-12-28_13-06-20.mp4