Getting name of a spacestation

Discussion in 'Support' started by dierke9, Feb 28, 2019.

  1. dierke9

    dierke9 Member

    Joined:
    Feb 28, 2019
    Messages:
    1
    Likes Received:
    0
    For a mod i'm currently working on i need to get the name of a spacestation the moment the player joins that spacestation (with the EntityJoinWorldEvent)
    When i try to get the spacestationdata via SpaceStationWorldData#getStationData i always get back null.

    Is there something i'm currently missing or is there a better way tp get the name of a spacestation?

    Code:
     Satellite satellite = (Satellite) body;
        String parent;
        if(satellite.getParentPlanet().getUnlocalizedName().equalsIgnoreCase("planet.overworld")){
            parent = "Earth";
        }else{
                parent = satellite.getParentPlanet().getLocalizedName();
         }
        SpaceStationWorldData data = SpaceStationWorldData.getStationData(e.getWorld(), satellite.getID(), (EntityPlayer) e.getEntity());
                                    
    In this case data is always null giving a npe later on in my code. Body is of type CelestialBody and i get it via
    GalaxyRegistry#getCelestialBodyFromDimensionID
     

Share This Page