Java Code Examples for net.minecraft.init.Blocks#log2()

The following examples show how to use net.minecraft.init.Blocks#log2() . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * Called to update the entity's position/logic.
 */
@Override
public void onUpdate() {
	super.onUpdate();

	if (!this.world.isRemote) {
		boolean nearLog = false;
		for (EnumFacing facing : EnumFacing.values()) {
			BlockPos pos = this.getPosition().offset(facing);
			Block block = this.world.getBlockState(pos).getBlock();
			if (block == Blocks.LOG || block == Blocks.LOG2) {
				nearLog = true;
			}
		}
		this.setBesideClimbableBlock((this.collidedHorizontally && nearLog) || (this.collidedHorizontally && this.climbTimeWithoutLog < 15));
		if (this.collidedHorizontally && !nearLog) {
			this.climbTimeWithoutLog++;
		} else if (this.climbTimeWithoutLog > 0 || (this.collidedHorizontally && nearLog)) {
			this.climbTimeWithoutLog = 0;
		}
	}
}
 
Example 2
private boolean isGroundBlock(IBlockState blockState) {
	if (blockState == null || blockState.getBlock() == Blocks.LEAVES || blockState.getBlock() == Blocks.LEAVES2 || blockState.getBlock() == Blocks.LOG || blockState.getBlock() == Blocks.LOG2
			|| blockState.getBlock() instanceof BlockBush) {
		return false;
	}
	return blockState.isOpaqueCube();
}
 
Example 3
public static Block getBlockId(Wood type){
	switch(type){
	case OAK: return Blocks.LOG;
	case SPRUCE: return Blocks.LOG;
	case BIRCH: return Blocks.LOG;
	case JUNGLE: return Blocks.LOG;
	case ACACIA: return Blocks.LOG2;
	case DARKOAK: return Blocks.LOG2;
	default: return Blocks.LOG;
	}
}