diff --git a/build.gradle b/build.gradle index aead827..45b25b9 100644 --- a/build.gradle +++ b/build.gradle @@ -61,7 +61,7 @@ processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { - include 'mcmod/info' + include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version diff --git a/resources/mcmod.template b/resources/mcmod.template deleted file mode 100644 index e8cb61b..0000000 --- a/resources/mcmod.template +++ /dev/null @@ -1,21 +0,0 @@ -{ - "modinfoversion": 2, - "modlist": [{ - "modid": "@MODID@", - "name": "@MODNAME@", - "description": "@DESCRIPTION@", - "version": "@VERSION@", - "mcversion": "@MCVERSION@", - "url": "@URL@", - "updateUrl": "@UPDATEURL@", - "authors": [ @AUTHORS@ ], - "credits": "@CREDITS@", - "logoFile": "@LOGOFILE@", - "screenshots": [ @SCREENSHOTS@ ], - "parent": "@PARENT@", - "requiredMods": [ @REQUIREDMODS@ ], - "dependencies": [ @DEPENDENCIES@ ], - "dependants": [ @DEPENDANTS@ ], - "useDependencyInformation": "@USEDEPENDANCYINFORMATION@" - }] -} diff --git a/src/main/java/tppitweaks/command/CommandTPPI.java b/src/main/java/tppitweaks/command/CommandTPPI.java index fef910b..28d2e0a 100644 --- a/src/main/java/tppitweaks/command/CommandTPPI.java +++ b/src/main/java/tppitweaks/command/CommandTPPI.java @@ -9,6 +9,7 @@ import java.util.logging.Level; import net.minecraft.command.CommandBase; +import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -317,6 +318,6 @@ public static String getProperName(String modid) @Override public int compareTo(Object arg0) { - return 0; // wat + return this.compareTo((ICommand) arg0); } } diff --git a/src/main/java/tppitweaks/util/FileLoader.java b/src/main/java/tppitweaks/util/FileLoader.java index 86457f3..b780b78 100644 --- a/src/main/java/tppitweaks/util/FileLoader.java +++ b/src/main/java/tppitweaks/util/FileLoader.java @@ -3,6 +3,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; @@ -184,7 +185,26 @@ public static InputStream getGuideText() public static InputStream getChangelogText() throws FileNotFoundException { + File changelog = new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt"); + + if (!changelog.exists()) + { + FileWriter fw; + try + { + changelog.createNewFile(); + fw = new FileWriter(changelog); + fw.write("Default Changelog, please make sure the correct changelog exists in the TPPI directory before launching next time!"); + fw.flush(); + fw.close(); + } catch (IOException e1) { + TPPITweaks.logger.severe("Could not create default changelog!"); + e1.printStackTrace(); + } + } + changelogText = new FileInputStream(new File(ConfigurationHandler.cfg.getParent() + "/changelog.txt")); + return changelogText; } diff --git a/src/main/java/tppitweaks/util/TxtParser.java b/src/main/java/tppitweaks/util/TxtParser.java index 0e99b4c..b62f6bf 100644 --- a/src/main/java/tppitweaks/util/TxtParser.java +++ b/src/main/java/tppitweaks/util/TxtParser.java @@ -25,6 +25,8 @@ public static ArrayList parseFileMain(InputStream file) { ArrayList bookText = new ArrayList(); useableLines.clear(); + + if (file == null) return new ArrayList(); Scanner scanner; scanner = new Scanner(file); diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 1d1ff08..6973d09 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,7 +2,7 @@ "modid": "TPPITweaks", "name": "TPPI Tweaks", "description": "Does some useful stuff for the TPPI modpack.", - "version": "0.6.2", + "version": "1.0.0", "mcversion": "1.6.4", "authors": [ "The TPPI Team" ], "requiredMods": [ "Forge" ]