Add Material#getPlacedMaterial#6680
Conversation
|
Just curious - as for signs, will it return the normal one or its wall variation? |
I don’t recall for sure. Most of the time, if it returns a not null value, it is itself. There are only 12 materials for which it doesn’t return itself (and is not null) |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have an answer for you, for any standing + wall variants (signs, heads, banners), its going to give you the standing one. This isn't smth that can really be addressed well until the Material enum is gone. |
50dc85a to
0c49d93
Compare
|
Rebased for 1.18.1 |
0c49d93 to
54091fa
Compare
|
Rebased for 1.18.2. Adds two methods to Material, |
54091fa to
685adc9
Compare
| + * @return the placed material or null | ||
| + * @throws IllegalArgumentException if this is not an item | ||
| + */ | ||
| + public @Nullable Material getPlacedMaterial(boolean onWall) { |
There was a problem hiding this comment.
For readability's sake I think it would be nice to give this method a different name instead of a more arbitrary looking boolean parameter
| + * For items that create blocks that could be standing or | ||
| + * wall-mounted like skulls, torches, coral, signs, banners, etc., | ||
| + * this returns the standing version. |
There was a problem hiding this comment.
The other method could be linked here
|
Superseded by #9607 |
No description provided.