Use MC data dir for persistent data

- Fix spelling, it’s “persistent” not “presistant”
- Update CCL, IChunkLoadTile (required by FMP) was added in 1.1.1.109
- Add IDEA files to .gitignore

Fixes #1340
This commit is contained in:
Shadowfacts committed 2015-09-06 11:50:03 -04:00
1 parent dfe14da9db
commit e1e7fd4c89
7 files changed
+24 -21

No files matched your search

@@ -26,7 +26,7 @@ import vazkii.botania.client.gui.lexicon.GuiLexiconEntry;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibMisc;
public final class PresistantVariableHelper {
public final class PersistentVariableHelper {
private static final String TAG_FIRST_LOAD = "firstLoad";
private static final String TAG_BOOKMARK_COUNT = "bookmarkCount";
@@ -48,7 +48,7 @@ import vazkii.botania.client.core.handler.DebugHandler;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.client.core.handler.LightningHandler;
import vazkii.botania.client.core.handler.MultiblockRenderHandler;
import vazkii.botania.client.core.handler.PresistantVariableHelper;
import vazkii.botania.client.core.handler.PersistentVariableHelper;
import vazkii.botania.client.core.handler.SubTileRadiusRenderHandler;
import vazkii.botania.client.core.handler.TooltipHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
@@ -178,7 +178,7 @@ public class ClientProxy extends CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
PresistantVariableHelper.setCacheFile(new File(event.getModConfigurationDirectory().getParent(), "BotaniaVars.dat"));
PersistentVariableHelper.setCacheFile(new File(Minecraft.getMinecraft().mcDataDir, "BotaniaVars.dat"));
}
@Override
@@ -210,10 +210,10 @@ public class ClientProxy extends CommonProxy {
initRenderers();
try {
PresistantVariableHelper.load();
PresistantVariableHelper.save();
PersistentVariableHelper.load();
PersistentVariableHelper.save();
} catch (IOException e) {
FMLLog.severe("Botania's Presistant Variables couldn't load!");
FMLLog.severe("Botania's persistent Variables couldn't load!");
e.printStackTrace();
}
}
@@ -39,7 +39,7 @@ import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconCategory;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.PresistantVariableHelper;
import vazkii.botania.client.core.handler.PersistentVariableHelper;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.core.proxy.ClientProxy;
import vazkii.botania.client.gui.GuiAchievementsHacky;
@@ -109,9 +109,9 @@ public class GuiLexicon extends GuiScreen {
public final void initGui() {
super.initGui();
if(PresistantVariableHelper.firstLoad) {
PresistantVariableHelper.firstLoad = false;
PresistantVariableHelper.saveSafe();
if(PersistentVariableHelper.firstLoad) {
PersistentVariableHelper.firstLoad = false;
PersistentVariableHelper.saveSafe();
}
String key = getNotesKey();
@@ -164,7 +164,7 @@ public class GuiLexicon extends GuiScreen {
GuiButtonUpdateWarning button = new GuiButtonUpdateWarning(-4, left - 6, top + 60);
buttonList.add(button);
if(PresistantVariableHelper.lastBotaniaVersion.equals(LibMisc.VERSION)) {
if(PersistentVariableHelper.lastBotaniaVersion.equals(LibMisc.VERSION)) {
button.enabled = false;
button.visible = false;
}
@@ -350,13 +350,13 @@ public class GuiLexicon extends GuiScreen {
if(isShiftKeyDown()) {
try {
if(Desktop.isDesktopSupported())
Desktop.getDesktop().browse(new URI("http://botaniamod.net/changelog.php#" + PresistantVariableHelper.lastBotaniaVersion.replaceAll("\\.|\\s", "-")));
Desktop.getDesktop().browse(new URI("http://botaniamod.net/changelog.php#" + PersistentVariableHelper.lastBotaniaVersion.replaceAll("\\.|\\s", "-")));
} catch (Exception e) {
e.printStackTrace();
}
} else {
PresistantVariableHelper.lastBotaniaVersion = LibMisc.VERSION;
PresistantVariableHelper.saveSafe();
PersistentVariableHelper.lastBotaniaVersion = LibMisc.VERSION;
PersistentVariableHelper.saveSafe();
par1GuiButton.visible = false;
par1GuiButton.enabled = false;
}
@@ -393,7 +393,7 @@ public class GuiLexicon extends GuiScreen {
bookmarksNeedPopulation = true;
if(modified)
PresistantVariableHelper.saveSafe();
PersistentVariableHelper.saveSafe();
}
@Override
@@ -577,7 +577,7 @@ public class GuiLexicon extends GuiScreen {
if(changed) {
notes.put(getNotesKey(), note);
PresistantVariableHelper.saveSafe();
PersistentVariableHelper.saveSafe();
}
} else Keyboard.enableRepeatEvents(false);
}
@@ -23,7 +23,7 @@ import org.lwjgl.opengl.GL12;
import vazkii.botania.client.challenge.Challenge;
import vazkii.botania.client.challenge.ModChallenges;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.PresistantVariableHelper;
import vazkii.botania.client.core.handler.PersistentVariableHelper;
import vazkii.botania.client.gui.lexicon.button.GuiButtonBack;
import vazkii.botania.common.lexicon.page.PageText;
@@ -112,7 +112,7 @@ public class GuiLexiconChallenge extends GuiLexicon implements IParented {
} else if(par1GuiButton.id == 13) {
challenge.complete = !challenge.complete;
setCompleteButtonTitle();
PresistantVariableHelper.saveSafe();
PersistentVariableHelper.saveSafe();
} else if(par1GuiButton.id == NOTES_BUTTON_ID)
notesEnabled = !notesEnabled;
}
@@ -20,7 +20,7 @@ import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.PresistantVariableHelper;
import vazkii.botania.client.core.handler.PersistentVariableHelper;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.gui.lexicon.GuiLexicon;
@@ -45,7 +45,7 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon {
drawTexturedModalRect(xPosition, yPosition, red ? 153 : 142, 180, 11, 11);
List<String> tooltip = new ArrayList();
String version = PresistantVariableHelper.lastBotaniaVersion;
String version = PersistentVariableHelper.lastBotaniaVersion;
for(int i = 0; i < 6; i++) {
tooltip.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocal("botaniamisc.changes" + i), version).replaceAll("&", "\u00a7"));
if(i == 3)