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

The following examples show how to use net.minecraft.init.Blocks#OAK_DOOR . 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: VillagePieceBlockMap.java    From ToroQuest with GNU General Public License v3.0 5 votes vote down vote up
protected IBlockState biomeSpecificDoor(IBlockState in) {
	BlockDoor newBlock;
	switch (this.structureType) {
	case 2:
		newBlock = Blocks.ACACIA_DOOR;
		break;
	case 3:
		newBlock = Blocks.SPRUCE_DOOR;
		break;
	default:
		newBlock = Blocks.OAK_DOOR;
		break;
	}
	return newBlock.getDefaultState().withProperty(BlockBed.FACING, in.getValue(BlockDoor.FACING));
}
 
Example 2
Source File: ChunkProviderSurface.java    From TFC2 with GNU General Public License v3.0 5 votes vote down vote up
protected void genRoom(ChunkPrimer primer, Dungeon dungeon, DungeonRoom room)
{
	RoomSchematic schem = room.getSchematic();

	for(SchemBlock b : schem.getProcessedBlockList(dungeon))
	{
		DungeonDirection borderFacing = isOnBorder(b);
		if(borderFacing != null && b.state.getBlock() == Blocks.OAK_DOOR)
		{
			if(!room.hasConnection(borderFacing))
			{
				primer.setBlockState(8+b.pos.getX(), room.getPosition().getY() + b.pos.getY(), 8+b.pos.getZ(), dungeon.blockMap.get("dungeon_wall"));
				continue;
			}
			else if(room.hasConnection(borderFacing) && !room.getConnection(borderFacing).placeDoor)
			{
				primer.setBlockState(8+b.pos.getX(), room.getPosition().getY() + b.pos.getY(), 8+b.pos.getZ(), Blocks.AIR.getDefaultState());
				continue;
			}
		}
		else if(borderFacing != null && b.state.getBlock() == Blocks.AIR)
		{
			if(!room.hasConnection(borderFacing) && b.pos.getY() < 10)//the <10 check here makes sure that the surface sections of entrances
			{
				primer.setBlockState(8+b.pos.getX(), room.getPosition().getY() + b.pos.getY(), 8+b.pos.getZ(), dungeon.blockMap.get("dungeon_wall"));
				continue;
			}
		}
		primer.setBlockState(8+b.pos.getX(), room.getPosition().getY() + b.pos.getY(), 8+b.pos.getZ(), b.state);
	}
}