PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.98k stars 2.31k forks source link

Material#isItem method is missleading #9952

Closed EinSchokomuffin closed 11 months ago

EinSchokomuffin commented 11 months ago

Expected behavior

For example the material Material#BAMBOO_WALL_SIGN is NOT an obtainable item in survival minecraft. So the method is expected to return false.

Observed/Actual behavior

When I check the material Material#BAMBOO_WALL_SIGN with the isItem method it returns true.

Steps/models to reproduce

System.out.println(Material.BAMBOO_WALL_SIGN.isItem());

Plugin and Datapack List

none

Paper version

This server is running Paper version git-Paper-196 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 773dd72) You are running the latest version

Other

No response

Malfrador commented 11 months ago

I am unable to reproduce this, both on 1.20.1 and 1.20.2. Just logging Material.BAMBOO_WALL_SIGN.isItem() results in false, as expected. The check is just done with one big switch statement (starting at line 8514 in Material), it would be a bit unusual if that is suddenly returning different things.

EinSchokomuffin commented 11 months ago

Sorry, it was an error by me.