package zmaster587.advancedRocketry.backwardCompat;

import zmaster587.advancedRocketry.AdvancedRocketry;
import zmaster587.advancedRocketry.dimension.DimensionManager;

public class VersionCompat {
	public static void upgradeDimensionManagerPostLoad(String prevVersion) {
		if(AdvancedRocketry.version.equals(prevVersion) || AdvancedRocketry.version.startsWith("%"))
			return;
		String version = prevVersion;
		
		if(version.contains("-"))
			version = prevVersion.split("-")[1];

		//Upgrade gas giants
		if(version.isEmpty() || version.compareTo("0.9.1") < 1) {
			for(int dimId : DimensionManager.getInstance().getLoadedDimensions()) {

				if(dimId >= DimensionManager.GASGIANT_DIMID_OFFSET)
					DimensionManager.getInstance().getDimensionProperties(dimId).setGasGiant();
			}
			DimensionManager.getSol().setName("Sol");
		}
	}
}

@@ -268,16 +268,21 @@
 on) %7B%0A%09%09
+%0A%09%09/*
 if(Advan
@@ -830,14 +830,16 @@
 l%22);%0A%09%09%7D
+*/
 %0A%09%7D%0A%7D%0A

remove old version compat, suspected of causing trouble, see #436