Rename version variables to make more sense

This commit is contained in:
Dominika 2020-07-13 19:43:40 -04:00
parent a7aace78b3
commit 04936ec928
No known key found for this signature in database
GPG Key ID: B4A5A6DCA70F861F
7 changed files with 17 additions and 19 deletions

View File

@ -8,8 +8,8 @@ CUR_BETA="$(cat ./scripts/curBeta)"
CUR_RELEASE="$(cat ./scripts/curRelease)"
sed -i "s/modVersion=.*/modVersion=${CUR_VER:1}$CUR_BETA/" gradle.properties
sed -i "s/MODVER = \".*\";/MODVER = \"$CUR_VER$CUR_BETA\";/" src/main/java/me/zeroeightsix/kami/KamiMod.java
sed -i "s/MODVERSMALL = \".*\";/MODVERSMALL = \"$CUR_VER$CUR_BETA\";/" src/main/java/me/zeroeightsix/kami/KamiMod.java
sed -i "s/MODVERBROAD = \".*\";/MODVERBROAD = \"$CUR_RELEASE\";/" src/main/java/me/zeroeightsix/kami/KamiMod.java
sed -i "s/VER_FULL_BETA = \".*\";/VER_FULL_BETA = \"$CUR_VER$CUR_BETA\";/" src/main/java/me/zeroeightsix/kami/KamiMod.java
sed -i "s/VER_SMALL = \".*\";/VER_SMALL = \"$CUR_VER$CUR_BETA\";/" src/main/java/me/zeroeightsix/kami/KamiMod.java
sed -i "s/VER_STABLE = \".*\";/VER_STABLE = \"$CUR_RELEASE\";/" src/main/java/me/zeroeightsix/kami/KamiMod.java
sed -i "s/\"version\": \".*\",/\"version\": \"${CUR_VER:1}$CUR_BETA\",/" src/main/resources/mcmod.info

View File

@ -64,15 +64,15 @@ import static me.zeroeightsix.kami.DiscordPresence.setCustomIcons;
@Mod(
modid = KamiMod.MODID,
name = KamiMod.MODNAME,
version = KamiMod.MODVER
version = KamiMod.VER_FULL_BETA
)
public class KamiMod {
public static final String MODNAME = "KAMI Blue";
public static final String MODID = "kamiblue";
public static final String MODVER = "v1.1.7-beta"; // this is changed to v1.x.x-commit for debugging during travis releases
public static final String MODVERSMALL = "v1.1.7-beta"; // shown to the user
public static final String MODVERBROAD = "v1.1.6"; // used for update checking
public static final String VER_FULL_BETA = "v1.1.7-beta"; // this is changed to v1.x.x-commit for debugging by automatic builds
public static final String VER_SMALL = "v1.1.7-beta"; // shown to the user, unchanged
public static final String VER_STABLE = "v1.1.6"; // used for update checking
public static final String APP_ID = "638403216278683661";
@ -127,13 +127,13 @@ public class KamiMod {
public void postInit(FMLPostInitializationEvent event) {
setCustomIcons();
if (MODULE_MANAGER.getModuleT(CommandConfig.class).customTitle.getValue()) {
Display.setTitle(MODNAME + " " + KAMI_KANJI + " " + MODVERSMALL);
Display.setTitle(MODNAME + " " + KAMI_KANJI + " " + VER_SMALL);
}
}
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
log.info("\n\nInitializing " + MODNAME + " " + MODVER);
log.info("\n\nInitializing " + MODNAME + " " + VER_FULL_BETA);
MODULE_MANAGER.register();
@ -282,16 +282,16 @@ public class KamiMod {
JsonParser parser = new JsonParser();
String latestVersion = parser.parse(IOUtils.toString(new URL(UPDATE_JSON))).getAsJsonObject().getAsJsonObject("stable").get("name").getAsString();
isLatest = latestVersion.equals(MODVERBROAD);
isLatest = latestVersion.equals(VER_STABLE);
latest = latestVersion;
if (!isLatest) {
KamiMod.log.warn("You are running an outdated version of KAMI Blue.\nCurrent: " + MODVERBROAD + "\nLatest: " + latestVersion);
KamiMod.log.warn("You are running an outdated version of KAMI Blue.\nCurrent: " + VER_STABLE + "\nLatest: " + latestVersion);
return;
}
KamiMod.log.info("Your KAMI Blue (" + MODVERBROAD + ") is up-to-date with the latest stable release.");
KamiMod.log.info("Your KAMI Blue (" + VER_STABLE + ") is up-to-date with the latest stable release.");
} catch (IOException e) {
latest = null;

View File

@ -47,7 +47,7 @@ public class HelpCommand extends Command {
String commandPrefix = Command.getCommandPrefix();
if (args[0] == null) {
sendStringChatMessage(new String[]{
"KAMI Blue " + KamiMod.MODVER,
"KAMI Blue " + KamiMod.VER_FULL_BETA,
"&7Press &r" + MODULE_MANAGER.getModule(ClickGUI.class).getBindName() + "&7 to open GUI",
"&7see &b" + WEBSITE_LINK + "&7 for a full version of the faq",
commandPrefix + "commands&7 to view all available commands",

View File

@ -8,8 +8,6 @@ import net.minecraft.client.ClientBrandRetriever;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.ForgeClientHandler;
import net.minecraftforge.client.MinecraftForgeClient;
import org.apache.commons.lang3.StringUtils;
import org.lwjgl.opengl.GL11;
@ -54,7 +52,7 @@ public class TroubleshootCommand extends Command {
enabled.set(StringUtils.chop(StringUtils.chop(String.valueOf(enabled)))); // this looks horrible but I don't know how else to do it sorry
sendChatMessage("Enabled modules: " + f + "\n" + TextFormatting.GRAY + enabled);
if (args.length >= 2) return;
sendChatMessage(ClientBrandRetriever.getClientModName() + " " + KamiMod.MODVER);
sendChatMessage(ClientBrandRetriever.getClientModName() + " " + KamiMod.VER_FULL_BETA);
sendChatMessage("CPU: " + OpenGlHelper.getCpu() + " GPU: " + GlStateManager.glGetString(GL11.GL_VENDOR));
sendChatMessage("Please send a screenshot of the full output to the developer or moderator who's helping you!");
}

View File

@ -119,7 +119,7 @@ public class DiscordNotifs extends Module {
private void sendMessage(String content, String avatarUrl) {
TemmieWebhook tm = new TemmieWebhook(url.getValue());
DiscordMessage dm = new DiscordMessage(KamiMod.MODNAME + " " + KamiMod.MODVER, content, avatarUrl);
DiscordMessage dm = new DiscordMessage(KamiMod.MODNAME + " " + KamiMod.VER_FULL_BETA, content, avatarUrl);
tm.sendMessage(dm);
}

View File

@ -72,7 +72,7 @@ public class InfoOverlay extends Module {
public ArrayList<String> infoContents() {
ArrayList<String> infoContents = new ArrayList<>();
if (version.getValue()) {
infoContents.add(getStringColour(setToText(firstColour.getValue())) + KamiMod.KAMI_KANJI + getStringColour(setToText(secondColour.getValue())) + " " + KamiMod.MODVERSMALL);
infoContents.add(getStringColour(setToText(firstColour.getValue())) + KamiMod.KAMI_KANJI + getStringColour(setToText(secondColour.getValue())) + " " + KamiMod.VER_SMALL);
} if (username.getValue()) {
infoContents.add(getStringColour(setToText(firstColour.getValue())) + "Welcome" + getStringColour(setToText(secondColour.getValue())) + " " + mc.getSession().getUsername() + "!");
} if (time.getValue()) {

View File

@ -39,7 +39,7 @@ class DiscordRPC : Module() {
fun getLine(line: LineInfo?): String {
return when (line) {
LineInfo.VERSION -> KamiMod.MODVERSMALL
LineInfo.VERSION -> KamiMod.VER_SMALL
LineInfo.WORLD -> if (mc.isIntegratedServerRunning) "Singleplayer" else if (mc.getCurrentServerData() != null) "Multiplayer" else "Main Menu"
LineInfo.DIMENSION -> playerDimension(mc)
LineInfo.USERNAME -> if (mc.player != null) mc.player.name else mc.getSession().username