use of net.minecraft.block.BlockStandingSign in project MC-Prefab by Brian-Wuest.
the class StructureAlternateStart method CustomBlockProcessingHandled.
@Override
protected Boolean CustomBlockProcessingHandled(StructureConfiguration configuration, BuildBlock block, World world, BlockPos originalPos, EnumFacing assumedNorth, Block foundBlock, IBlockState blockState, EntityPlayer player) {
HouseConfiguration houseConfig = (HouseConfiguration) configuration;
if ((!houseConfig.addBed && foundBlock instanceof BlockBed) || (!houseConfig.addChest && foundBlock instanceof BlockChest) || (!houseConfig.addTorches && foundBlock instanceof BlockTorch) || (!houseConfig.addCraftingTable && (foundBlock instanceof BlockWorkbench || foundBlock instanceof BlockFurnace))) {
// "handled"
return true;
}
if (foundBlock instanceof BlockFurnace) {
this.furnacePosition = block.getStartingPosition().getRelativePosition(originalPos, this.getClearSpace().getShape().getDirection(), configuration.houseFacing);
} else if (foundBlock instanceof BlockTrapDoor && houseConfig.addMineShaft) {
// The trap door will still be added, but the mine shaft may not be
// built.
this.trapDoorPosition = block.getStartingPosition().getRelativePosition(originalPos, this.getClearSpace().getShape().getDirection(), configuration.houseFacing);
} else if (foundBlock instanceof BlockChest && this.chestPosition == null) {
this.chestPosition = block.getStartingPosition().getRelativePosition(originalPos, this.getClearSpace().getShape().getDirection(), configuration.houseFacing);
} else if (foundBlock instanceof BlockStandingSign) {
this.signPosition = block.getStartingPosition().getRelativePosition(originalPos, this.getClearSpace().getShape().getDirection(), configuration.houseFacing);
}
if (foundBlock.getRegistryName().getResourceDomain().equals(Blocks.STAINED_GLASS.getRegistryName().getResourceDomain()) && foundBlock.getRegistryName().getResourcePath().equals(Blocks.STAINED_GLASS.getRegistryName().getResourcePath())) {
blockState = blockState.withProperty(BlockStainedGlass.COLOR, houseConfig.glassColor);
block.setBlockState(blockState);
this.priorityOneBlocks.add(block);
return true;
} else if (foundBlock.getRegistryName().getResourceDomain().equals(Blocks.STAINED_GLASS_PANE.getRegistryName().getResourceDomain()) && foundBlock.getRegistryName().getResourcePath().equals(Blocks.STAINED_GLASS_PANE.getRegistryName().getResourcePath())) {
block.setBlockState(foundBlock.getStateFromMeta(houseConfig.glassColor.getMetadata()));
this.priorityOneBlocks.add(block);
return true;
}
return false;
}
Aggregations