Getting name of a spacestation

dierke9

Member
Feb 28, 2019
1
0
1
27
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