Fixed warnings for VersionChecker by removing it )

This commit is contained in:
drcrazy 2017-10-11 02:07:08 +03:00
parent 8692bef2bb
commit 387d4287de
2 changed files with 1 additions and 76 deletions

View file

@ -42,7 +42,6 @@ import reborncore.common.multiblock.MultiblockEventHandler;
import reborncore.common.multiblock.MultiblockServerTickHandler;
import reborncore.common.network.RegisterPacketEvent;
import reborncore.common.util.LogHelper;
import reborncore.common.util.VersionChecker;
import techreborn.api.TechRebornAPI;
import techreborn.client.GuiHandler;
import techreborn.command.TechRebornDevCommand;
@ -76,7 +75,6 @@ public class Core {
public static LogHelper logHelper = new LogHelper(new ModInfo());
public static TechRebornWorldGen worldGen;
public static File configDir;
public VersionChecker versionChecker;
//enable dev featues with -Dtechreborn.devFeatues=true
public static final boolean DEV_FEATURES = Boolean.parseBoolean(System.getProperty("techreborn.devFeatues", "false"));
@ -109,7 +107,6 @@ public class Core {
EntityRegistry.registerModEntity(new ResourceLocation("techreborn", "nuke"), EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true);
CompatManager.isIC2Loaded = Loader.isModLoaded("ic2");
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
compatModule.preInit(event);
}
@ -117,10 +114,7 @@ public class Core {
//Ore Dictionary
OreDict.init();
proxy.preInit(event);
versionChecker = new VersionChecker("TechReborn", new ModInfo());
versionChecker.checkVersionThreaded();
//Register ModRecipes
ModRecipes.init();
logHelper.info("PreInitialization Complete");
}

View file

@ -1,69 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.client;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.fml.client.GuiModList;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import reborncore.client.gui.GuiUtil;
import techreborn.Core;
import java.awt.*;
import java.util.ArrayList;
public class VersionCheckerClient {
ResourceLocation texture;
public VersionCheckerClient() {
texture = new ResourceLocation("textures/gui/demo_background.png");
}
@SubscribeEvent
public void drawGui(GuiScreenEvent.DrawScreenEvent event) {
if (event.getGui() instanceof GuiModList) {
ArrayList<String> changeLog = Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion();
String s = "";
if (Core.INSTANCE.versionChecker.isChecking) {
s = "Checking for update...";
} else if (Core.INSTANCE.versionChecker.isLatestVersion()) {
s = "You have the latest version of TechReborn";
} else {
s = "There is an update for TechReborn with " + changeLog.size() + " changes.";
}
event.getGui().drawString(event.getGui().mc.fontRenderer, s, 10, 5, Color.white.getRGB());
if (!Core.INSTANCE.versionChecker.isLatestVersion()) {
if (event.getMouseY() < 20) {
GuiUtil.drawTooltipBox(5, 15, 330, changeLog.size() * 10 + 5);
int y = 20;
for (String change : changeLog) {
event.getGui().drawString(event.getGui().mc.fontRenderer, change, 10, y, Color.white.getRGB());
y += 10;
}
}
}
}
}
}