Merge pull request #1872 from Dynious/6.0.x

Made sure Version IMC message is also sent after init phase
This commit is contained in:
SpaceToad 2014-06-11 01:36:12 +02:00
commit 4931bc2954

View file

@ -19,6 +19,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentText;
import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.Loader;
import net.minecraftforge.common.config.Property; import net.minecraftforge.common.config.Property;
@ -225,9 +226,10 @@ public class Version implements Runnable {
/** /**
* This is an integration with Dynious Version Checker See * This is an integration with Dynious Version Checker See
* http://www.minecraftforum.net/topic/2721902-172 * http://www.minecraftforum.net/topic/2721902-
*/ */
public static void sendIMCOutdatedMessage() { public static void sendIMCOutdatedMessage() {
if (Loader.isModLoaded("VersionChecker")) {
NBTTagCompound compound = new NBTTagCompound(); NBTTagCompound compound = new NBTTagCompound();
compound.setString("modDisplayName", "BuildCraft"); compound.setString("modDisplayName", "BuildCraft");
compound.setString("oldVersion", VERSION); compound.setString("oldVersion", VERSION);
@ -236,13 +238,15 @@ public class Version implements Runnable {
compound.setString("updateUrl", "http://www.mod-buildcraft.com/download/"); compound.setString("updateUrl", "http://www.mod-buildcraft.com/download/");
compound.setBoolean("isDirectLink", false); compound.setBoolean("isDirectLink", false);
String changeLogString = ""; StringBuilder stringBuilder = new StringBuilder();
for (String changeLogLine : getChangelog()) { for (String changeLogLine : getChangelog()) {
changeLogString = changeLogString + changeLogLine + "\n"; stringBuilder.append(changeLogLine).append("\n");
} }
compound.setString("changeLog", changeLogString); compound.setString("changeLog", stringBuilder.toString());
sentIMCOutdatedMessage = FMLInterModComms.sendMessage("VersionChecker", "addUpdate", compound); FMLInterModComms.sendRuntimeMessage("BuildCraft|Core", "VersionChecker", "addUpdate", compound);
sentIMCOutdatedMessage = true;
}
} }
public static void displayChangelog(ICommandSender sender) { public static void displayChangelog(ICommandSender sender) {