Buggy code:
public class PortSimulation { private final Map map ; private final Stage stage = new Stage ( ) ; private final Group root = new Group ( ) ; private final PerspectiveCamera camera = new PerspectiveCamera ( true ) ; private boolean fullscreen = true ; private final Xform world = new Xform ( ) ; private final Xform cameraXform = new Xform ( ) ; private final Xform cameraXform2 = new Xform ( ) ; private final Xform cameraXform3 = new Xform ( ) ; private final Xform oceanGroup = new Xform ( ) ; private final Xform landGroup = new Xform ( ) ; private final Xform shipGroup = new Xform ( ) ; private final Xform monsterGroup = new Xform ( ) ; private final Xform dockGroup = new Xform ( ) ; private static final double CAMERA_INITIAL_DISTANCE = - 450 ; private static final double CAMERA_INITIAL_X_ANGLE = 30.0 ; private static final double CAMERA_INITIAL_Y_ANGLE = 120.0 ; private static final double CAMERA_NEAR_CLIP = 0.1 ; private static final double CAMERA_FAR_CLIP = 10000.0 ; private static final double MOUSE_SPEED = 0.1 ; private static final double ROTATION_SPEED = 2.0 ; private static final double TRACK_SPEED = 0.3 ; private double mousePosX ; private double mousePosY ; private double mouseOldX ; private double mouseOldY ; private double mouseDeltaX ; private double mouseDeltaY ; public PortSimulation ( Map map ) { } public void run ( ) { } private void handleMouse ( Scene scene , final Node root ) { } private void handleKeyboard ( Scene scene , final Node root ) { } private void buildCamera ( ) { } private void buildOcean ( ) { } private void buildLand ( ) { } private void buildShips ( ) { } private void buildMonsters ( ) { final PhongMaterial krakenMaterial = new PhongMaterial ( ) ; krakenMaterial . setDiffuseColor ( Color . RED ) ; krakenMaterial . setSpecularColor ( Color . PINK ) ; final PhongMaterial leviathanMaterial = new PhongMaterial ( ) ; leviathanMaterial . setDiffuseColor ( Color . BROWN ) ; leviathanMaterial . setSpecularColor ( Color . CHOCOLATE ) ; final PhongMaterial serpentMaterial = new PhongMaterial ( ) ; serpentMaterial . setDiffuseColor ( Color . DARKSLATEGRAY ) ; serpentMaterial . setSpecularColor ( Color . LIGHTSLATEGRAY ) ; final PhongMaterial godzillaMaterial = new PhongMaterial ( ) ; godzillaMaterial . setDiffuseColor ( Color . DARKGREEN ) ; godzillaMaterial . setSpecularColor ( Color . GREEN ) ; for ( SeaMonster monster : map . getMonsters ( ) ) { int mType = 0 ; if ( monster instanceof Kraken ) { mType = 1 ; } if ( monster instanceof Leviathan ) { mType = 2 ; } if ( monster instanceof SeaSerpent ) { mType = 3 ; } Sphere monsterModel = new Sphere ( ( mType == 0 ? 10 : 5 ) ) ; <START_BUG> monsterModel . setTranslateY ( ( mType == 0 ? 10 : 5 ) ) ; <END_BUG> monsterModel . setTranslateX ( ( 5 + ( ( monster . getCol ( ) ) * 10 ) ) ) ; monsterModel . setTranslateZ ( ( 5 + ( ( monster . getRow ( ) ) * 10 ) ) ) ; switch ( mType ) { case 0 : monsterModel . setMaterial ( godzillaMaterial ) ; break ; case 1 : monsterModel . setMaterial ( krakenMaterial ) ; break ; case 2 : monsterModel . setMaterial ( leviathanMaterial ) ; break ; case 3 : monsterModel . setMaterial ( serpentMaterial ) ; break ; } monsterGroup . getChildren ( ) . add ( monsterModel ) ; } world . getChildren ( ) . add ( monsterGroup ) ; monsterGroup . setVisible ( true ) ; } private void buildDocks ( ) { } }

Fix:
monsterModel . setTranslateY ( ( mType == 0 ? 10 + ( ( map . getMatrix ( ) [ monster . getRow ( ) ] [ monster . getCol ( ) ] ) == '*' ? 10 : 0 ) : 5 ) ) ;