Search in sources :

Example 1 with BlockDataMeta

use of org.bukkit.inventory.meta.BlockDataMeta in project Denizen-For-Bukkit by DenizenScript.

the class ItemBlockMaterial method adjust.

@Override
public void adjust(Mechanism mechanism) {
    // -->
    if (mechanism.matches("block_material") && mechanism.requireObject(MaterialTag.class)) {
        BlockDataMeta meta = (BlockDataMeta) item.getItemMeta();
        MaterialTag mat = mechanism.valueAsType(MaterialTag.class);
        meta.setBlockData(mat.getModernData());
        item.setItemMeta(meta);
    }
}
Also used : MaterialTag(com.denizenscript.denizen.objects.MaterialTag) BlockDataMeta(org.bukkit.inventory.meta.BlockDataMeta)

Aggregations

MaterialTag (com.denizenscript.denizen.objects.MaterialTag)1 BlockDataMeta (org.bukkit.inventory.meta.BlockDataMeta)1