use of net.glowstone.block.blocktype.BlockType in project Glowstone by GlowstoneMC.
the class ItemSign method rightClickBlock.
@Override
public void rightClickBlock(GlowPlayer player, GlowBlock target, BlockFace face, ItemStack holding, Vector clickedLoc) {
BlockType placeAs;
if (face == BlockFace.UP) {
placeAs = ItemTable.instance().getBlock(Material.SIGN_POST);
} else if (face == BlockFace.DOWN) {
return;
} else {
placeAs = ItemTable.instance().getBlock(Material.WALL_SIGN);
}
placeAs.rightClickBlock(player, target, face, holding, clickedLoc);
}
use of net.glowstone.block.blocktype.BlockType in project Glowstone by GlowstoneMC.
the class ItemTypesTest method hasAllMaterials.
@Test
public void hasAllMaterials() {
ItemType type = table.getItem(material);
// special cases
if (material == Material.AIR) {
assertThat("ItemType exists for air: " + type, type, nullValue());
return;
}
// check that it exists
assertThat("ItemType does not exist for " + material, type, notNullValue());
// check that its block status is correct
assertThat("Block status mismatch between " + material + "(" + material.isBlock() + ") and " + type, (type instanceof BlockType), is(material.isBlock()));
// check that material returned matches
assertThat("ItemType returned wrong material", type.getMaterial(), is(material));
// check that max stack size matches
assertThat("Maximum stack size was incorrect", type.getMaxStackSize(), is(material.getMaxStackSize()));
}
Aggregations