public void onPostBlockPlaced(World world, int x, int y, int z, int meta) {
setBlockBoundsBasedOnState(world, x, y, z);
if (TrackTools.isRailBlockAt(world, x, y - 1, z)) {
Block block = WorldPlugin.getBlock(world, x, y - 1, z);
BlockRailBase railBlock = (BlockRailBase) block;
if (railBlock.canMakeSlopes(world, x, y - 1, z)) {
int trackMeta = railBlock.getBasicRailMetadata(world, null, x, y - 1, z);
int ladderMeta = getLadderFacingMetadata(world, x, y, z);
int outputMeta = 0;
if (trackMeta == 0 && ladderMeta == 2)
outputMeta = 5;
else if (trackMeta == 0 && ladderMeta == 3)
outputMeta = 4;
else if (trackMeta == 1 && ladderMeta == 4)
outputMeta = 2;
else if (trackMeta == 1 && ladderMeta == 5)
outputMeta = 3;
if (outputMeta != 0) {
if (railBlock.isPowered())
outputMeta = outputMeta | (world.getBlockMetadata(x, y - 1, z) & 8);
world.setBlockMetadataWithNotify(x, y - 1, z, outputMeta, 3);
}
}
}