예제 #1
0
  @Override
  public void readFromNBT(NBTTagCompound tagCompound, GalaxyGenerator generator) {
    super.readFromNBT(tagCompound, generator);
    x = tagCompound.getFloat("X");
    y = tagCompound.getFloat("Y");
    z = tagCompound.getFloat("Z");
    size = tagCompound.getFloat("Size");
    mass = tagCompound.getFloat("Mass");
    type = tagCompound.getByte("Type");
    temperature = tagCompound.getInteger("Temperature");
    color = tagCompound.getInteger("Color");
    seed = tagCompound.getInteger("Seed");
    generated = tagCompound.getBoolean("Generated");
    NBTTagList planetList = tagCompound.getTagList("Planets", 10);
    for (int i = 0; i < planetList.tagCount(); i++) {
      Planet planet = new Planet();
      planet.readFromNBT(planetList.getCompoundTagAt(i), generator);
      addPlanet(planet);
      planet.setStar(this);
    }

    generateMissing(tagCompound, generator);
  }