use of sonar.flux.network.NetworkData in project Flux-Networks by SonarSonic.
the class FluxEvents method onWorldSave.
@SubscribeEvent
public void onWorldSave(WorldEvent.Save event) {
if (event.getWorld().isRemote) {
return;
}
if (event.getWorld().provider.getDimension() == FluxNetworks.saveDimension) {
MapStorage storage = event.getWorld().getPerWorldStorage();
NetworkData data = (NetworkData) storage.getOrLoadData(NetworkData.class, NetworkData.tag);
if (data == null && !FluxNetworks.getServerCache().getAllNetworks().isEmpty()) {
storage.setData(NetworkData.tag, new NetworkData(NetworkData.tag));
}
}
}
Aggregations