use of net.minecraft.block.BlockStairs in project NetherEx by LogicTechCorp.
the class PigtificateVillageCollection method getOutside.
private EnumFacing getOutside(BlockPos fenceGatePos) {
IBlockState fenceGateState = world.getBlockState(fenceGatePos);
IBlockState stairState = world.getBlockState(fenceGatePos.up(2));
if (fenceGateState.getBlock() instanceof BlockFenceGate && stairState.getBlock() instanceof BlockStairs) {
EnumFacing fenceGateFacing = fenceGateState.getValue(BlockFenceGate.FACING);
EnumFacing stairFacing = stairState.getValue(BlockStairs.FACING);
if (stairFacing == fenceGateFacing || stairFacing == fenceGateFacing.getOpposite()) {
return stairFacing;
}
return null;
} else {
return null;
}
}
use of net.minecraft.block.BlockStairs in project minecolonies by Minecolonies.
the class StructureWrapper method isStructureBlockEqualWorldBlock.
/**
* Checks if the block in the world is the same as what is in the structure.
*
* @return true if the structure block equals the world block.
*/
public boolean isStructureBlockEqualWorldBlock() {
final IBlockState structureBlockState = structure.getBlockState(this.getLocalPosition());
final Block structureBlock = structureBlockState.getBlock();
//All worldBlocks are equal the substitution block
if (structureBlock == ModBlocks.blockSubstitution) {
return true;
}
final BlockPos worldPos = this.getBlockPosition();
final IBlockState worldBlockState = world.getBlockState(worldPos);
if (structureBlock == ModBlocks.blockSolidSubstitution && worldBlockState.getMaterial().isSolid()) {
return true;
}
//For the time being any flower pot is equal to each other.
if (structureBlock instanceof BlockDoor || structureBlock == Blocks.FLOWER_POT) {
return structureBlock == worldBlockState.getBlock();
} else if ((structureBlock instanceof BlockStairs && structureBlockState == worldBlockState) || BlockUtils.isGrassOrDirt(structureBlock, worldBlockState.getBlock(), structureBlockState, worldBlockState)) {
return true;
}
final Template.EntityInfo entityInfo = structure.getEntityinfo(this.getLocalPosition());
if (entityInfo != null) {
return false;
//todo get entity at position.
}
//had this problem in a super flat world, causes builder to sit doing nothing because placement failed
return worldPos.getY() <= 0 || structureBlockState == worldBlockState;
}
Aggregations