use of org.bukkit.block.Lockable in project Denizen-For-Bukkit by DenizenScript.
the class ItemLock method adjust.
@Override
public void adjust(Mechanism mechanism) {
// -->
if (mechanism.matches("lock")) {
BlockStateMeta bsm = ((BlockStateMeta) item.getItemMeta());
Lockable lockable = (Lockable) bsm.getBlockState();
lockable.setLock(mechanism.hasValue() ? mechanism.getValue().asString() : null);
bsm.setBlockState((BlockState) lockable);
item.setItemMeta(bsm);
}
}
Aggregations