Sponge equivalents of Bukkit materials

Hello!

I have several structure models, which are stored as instructions of type “put block of type A into location (X, Y, Z)”. They were created using Bukkit and now I want to re-use them in Sponge.

Which are the closest Sponge equivalents for the following Bukkit materials ?

  • Bukkit: Material.JACK_O_LANTERN Sponge: BlockTypes.LIT_PUMPKIN ?
  • Bukkit: Material.STEP Sponge: BlockTypes.SPRUCE_STAIRS ?
  • Bukkit: Material.WOOD Sponge: ?
  • Bukkit: Material.DOUBLE_STEP Sponge: BlockTypes.DOUBLE_WOODEN_SLAB ?
  • Bukkit: Material.WOOD_STAIRS Sponge: BlockTypes.OAK_STAIRS ?

Thanks in advance

Dmitri Pisarenko

Most of the materials are of the original base materials that existed from the beginning, so Material.WOOD I believe is BlockTypes.PLANKS since the specific types are BlockStates. STEP is more than likely whatever the basic slab block was initially, which I believe is WOODEN_SLAB for BlockTypes. The rest look about right.

1 Like

Here’s the most reliable way to find out in the future:

  1. Go to Bukkit’s Material source code.
  2. Find the declaration for whichever Material you need to convert. Identify the numerical ID - it should be the first parameter.
  3. Use an ID list to find out the text ID of the item.
  4. Use BlockTypes.<CAPITALIZED_TEXT_ID> or ItemTypes.<CAPITALIZED_TEXT_ID> in Sponge.
3 Likes