net.minecraft.block.BlockPistonBase Java Examples

The following examples show how to use net.minecraft.block.BlockPistonBase. 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: MapGenSpaceStation.java    From AdvancedRocketry with MIT License 6 votes vote down vote up
public static void generateStation(World world, int blockX, int blockY, int blockZ) {

		BlockPos pos = new BlockPos(blockX, blockY, blockZ); 

		//Center
		world.setBlockState(pos, AdvancedRocketryBlocks.blockConcrete.getDefaultState(), 6);
		world.setBlockState(pos.add(1,0,1), AdvancedRocketryBlocks.blockConcrete.getDefaultState(), 6);
		world.setBlockState(pos.add(-1,0,-1), AdvancedRocketryBlocks.blockConcrete.getDefaultState(), 6);
		world.setBlockState(pos.add(1,0,-1), AdvancedRocketryBlocks.blockConcrete.getDefaultState(), 6);
		world.setBlockState(pos.add(-1,0,1), AdvancedRocketryBlocks.blockConcrete.getDefaultState(), 6);


		for(EnumFacing dir : EnumFacing.HORIZONTALS) {
			world.setBlockState(pos.offset(dir), Blocks.PISTON.getDefaultState().withProperty(BlockPistonBase.FACING, dir), 6);
			generateArm(world, pos, dir);
		}

	}
 
Example #2
Source File: BlockTrap.java    From Artifacts with MIT License 5 votes vote down vote up
/**
 * Called when the block is placed in the world.
 */
@Override
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack)
{
    int l = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLiving);
    par1World.setBlockMetadataWithNotify(par2, par3, par4, l, 2);

    if (par6ItemStack.hasDisplayName())
    {
        ((TileEntityDispenser)par1World.getTileEntity(par2, par3, par4)).func_146018_a/*setCustomName*/(par6ItemStack.getDisplayName());
    }
}
 
Example #3
Source File: Piston.java    From minecraft-roguelike with GNU General Public License v3.0 4 votes vote down vote up
public static void generate(IWorldEditor editor, Coord origin, Cardinal dir, boolean sticky){
	
	MetaBlock piston = new MetaBlock(sticky ? Blocks.STICKY_PISTON : Blocks.PISTON);
	piston.withProperty(BlockPistonBase.FACING, Cardinal.facing(Cardinal.reverse(dir)));
	piston.set(editor, origin);
}