Move version numbers, urls and certificate hash to build.gradle
This commit is contained in:
@@ -15,14 +15,6 @@ public class Main
|
||||
{
|
||||
public static final String NAME = "World Handler";
|
||||
public static final String MODID = "worldhandler";
|
||||
public static final String MC_VERSION = "1.12.2";
|
||||
public static final String MC_COMPATIBLE = "1.12";
|
||||
public static final String VERSION = "2.1.1";
|
||||
public static final String FULL_VERSION = MC_VERSION + "-" + VERSION;
|
||||
public static final String NAME_AND_VERSION = NAME + " " + FULL_VERSION;
|
||||
public static final String URL = "https://minecraft.curseforge.com/projects/world-handler-command-gui";
|
||||
public static final String UPDATE_URL = "https://raw.githubusercontent.com/Exopandora/worldhandler/master/version.json";
|
||||
public static final String CERTIFICATE = "d6261bb645f41db84c74f98e512c2bb43f188af2";
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Mod(modid = Main.MODID, name = Main.NAME, acceptedMinecraftVersions = "[" + Main.MC_COMPATIBLE + ",)", version = Main.VERSION, canBeDeactivated = false, guiFactory = "exopandora.worldhandler.gui.config.GuiFactoryWorldHandler", updateJSON = Main.UPDATE_URL, clientSideOnly = true, certificateFingerprint = Main.CERTIFICATE)
|
||||
@Mod(modid = Main.MODID, name = Main.NAME, acceptedMinecraftVersions = "[$compatible,)", version = "$version", canBeDeactivated = false, guiFactory = "exopandora.worldhandler.gui.config.GuiFactoryWorldHandler", updateJSON = "$update_url", clientSideOnly = true, certificateFingerprint = "$certificate")
|
||||
public class WorldHandler
|
||||
{
|
||||
@Instance(Main.MODID)
|
||||
@@ -65,7 +65,7 @@ public class WorldHandler
|
||||
LOGGER = event.getModLog();
|
||||
LOGGER.info("Pre-Initialisation");
|
||||
LOGGER.info("First Release on March 28 2013 - 02:29 PM CET by Exopandora");
|
||||
LOGGER.info("Latest Version: " + Main.URL);
|
||||
LOGGER.info("Latest Version: $url");
|
||||
CONFIG = new Configuration(event.getSuggestedConfigurationFile());
|
||||
}
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ public class CommandWorldHandler extends CommandBase
|
||||
}
|
||||
else if(args[0].equalsIgnoreCase("version"))
|
||||
{
|
||||
sender.sendMessage(new TextComponentString("Installed: " + Main.MC_VERSION + "-" + Main.VERSION));
|
||||
sender.sendMessage(new TextComponentString("Installed: $mcversion-$version"));
|
||||
ComparableVersion target = ForgeVersion.getResult(Loader.instance().getIndexedModList().get(Main.MODID)).target;
|
||||
sender.sendMessage(new TextComponentString("Latest: " + Main.MC_VERSION + "-" + (target != null ? target : Main.VERSION)));
|
||||
sender.sendMessage(new TextComponentString("Latest: $mcversion-" + (target != null ? target : "$version")));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -541,7 +541,7 @@ public class GuiWorldHandlerContainer extends Container
|
||||
final int hexAlpha = (int) (0xFF * 0.2) << 24;
|
||||
final int color = ConfigSkin.getLabelColor() + hexAlpha;
|
||||
|
||||
this.fontRenderer.drawString(Main.MC_VERSION + "-" + Main.VERSION, this.width - this.fontRenderer.getStringWidth(Main.MC_VERSION + "-" + Main.VERSION) - 2, this.height - 10, color);
|
||||
this.fontRenderer.drawString("$mcversion-$version", this.width - this.fontRenderer.getStringWidth("$mcversion-$version") - 2, this.height - 10, color);
|
||||
|
||||
//TITLE
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.net.URI;
|
||||
|
||||
import exopandora.worldhandler.Main;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -19,7 +18,7 @@ public class ForumListener implements ActionListener
|
||||
{
|
||||
try
|
||||
{
|
||||
Desktop.getDesktop().browse(new URI(Main.URL));
|
||||
Desktop.getDesktop().browse(new URI("$url"));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@@ -27,5 +26,4 @@ public class ForumListener implements ActionListener
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public class InstallListener implements ActionListener
|
||||
File mods = new File(directory, "mods");
|
||||
File versions = new File(directory, "versions");
|
||||
|
||||
if(!this.isPartialFileNameInFolder(versions, Main.MC_VERSION, "Forge"))
|
||||
if(!this.isPartialFileNameInFolder(versions, "$mcversion", "Forge"))
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "Please install Mineceaft Forge", null, JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
@@ -54,8 +54,8 @@ public class InstallListener implements ActionListener
|
||||
try
|
||||
{
|
||||
Path path = new File(InstallListener.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).toPath();
|
||||
Files.copy(path, new File(mods, "WorldHandler-" + Main.FULL_VERSION + "-Universal.jar").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
JOptionPane.showMessageDialog(null, Main.NAME_AND_VERSION + " has been successfully installed", null, JOptionPane.INFORMATION_MESSAGE);
|
||||
Files.copy(path, new File(mods, "WorldHandler-$mcversion-$version-Universal.jar").toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
JOptionPane.showMessageDialog(null, Main.NAME + " $mcversion-$version has been successfully installed", null, JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class Window implements Runnable
|
||||
{
|
||||
private final String title = Main.NAME_AND_VERSION + " Installer";
|
||||
private final String title = Main.NAME + " $mcversion-$version Installer";
|
||||
private final JFrame frame = new JFrame();
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user