Java Code Examples for net.minecraft.init.Blocks#LEVER

The following examples show how to use net.minecraft.init.Blocks#LEVER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Lever.java    From minecraft-roguelike with GNU General Public License v3.0 5 votes vote down vote up
public static void generate(IWorldEditor editor, Cardinal dir, Coord pos, boolean active){
	
	MetaBlock lever = new MetaBlock(Blocks.LEVER);
	lever.withProperty(BlockLever.POWERED, active);
	if(dir == Cardinal.UP){
		lever.withProperty(BlockLever.FACING, EnumOrientation.UP_X);
	} else if(dir == Cardinal.DOWN){
		lever.withProperty(BlockLever.FACING, EnumOrientation.DOWN_X);
	} else {
		lever.withProperty(BlockLever.FACING, Cardinal.orientation(Cardinal.reverse(dir)));
	}
	lever.set(editor, pos);
}