//Move the block on top of the mobilizer
if (!worldObj.isRemote) {
TileEntity passenger = worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
IAppEngApi api = AEApi.instance();
//Prevent the passenger from popping off. Not sent to clients.
worldObj.setBlock(targetX, yCoord, targetZ, Block.getBlockFromName("stone"), 0, 0);
//Move non-TE blocks
Block passengerId = worldObj.getBlock(xCoord, yCoord + 1, zCoord);
if (worldObj.isAirBlock(xCoord, yCoord + 1, zCoord) || passengerId.canPlaceBlockAt(worldObj, targetX, yCoord + 1, targetZ)) {
if (passenger == null) {
if (passengerId != Block.getBlockFromName("bedrock") && passengerId != Block.getBlockFromName("")) {
worldObj.setBlock(targetX, yCoord + 1, targetZ, passengerId, worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), 3);
if (passengerId != Block.getBlockFromName("air") && passengerId != Block.getBlockFromName("piston_head")) {
worldObj.setBlock(xCoord, yCoord + 1, zCoord, Block.getBlockFromName("air"), 0, 2);
}
}
//If AE is installed, use its handler
} else if (api != null) {
if (api.registries().moveable().askToMove(passenger)) {
worldObj.setBlock(targetX, yCoord + 1, targetZ, worldObj.getBlock(xCoord, yCoord + 1, zCoord), worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), 3);
passenger.invalidate();
worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord);
api.registries().moveable().getHandler(passenger).moveTile(passenger, worldObj, targetX, yCoord + 1, targetZ);
api.registries().moveable().doneMoving(passenger);
passenger.validate();
}
//Handler IMovableTiles and vanilla TEs without AE
} else if (passenger instanceof IMovableTile || passenger.getClass().getName().startsWith("net.minecraft.tileentity")) {