Skip to content

Commit

Permalink
Fix up version check output format
Browse files Browse the repository at this point in the history
  • Loading branch information
OreCruncher committed Sep 7, 2015
1 parent 913f339 commit 555081f
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 79 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ dependencies {

compile "mcp.mobius.waila:Waila:1.5.10_1.7.10:dev"
compile 'net.sengir.forestry:forestry_1.7.10:3.6.3.20:dev'
compile name: "buildcraft", version: "7.0.21", classifier: "dev"
compile name: 'MineTweaker3', version: "Dev-1.7.10-3.0.9C", ext: 'jar'
compile name: "buildcraft", version: "7.0.22", classifier: "dev"
compile name: 'MineTweaker3', version: "Dev-1.7.10-3.0.10", ext: 'jar'

// you may put jars on which you depend on in ./libs
// or you may define them like so..
Expand Down
8 changes: 4 additions & 4 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
group = org.blockartistry.mod.ThermalRecycling
archive = ThermalRecycling

version.mod.major = 0
version.mod.minor = 4
version.mod.revis = 4
version.mod.patch = .1ALPHA
version.mod.major = 1
version.mod.minor = 0
version.mod.revis = 1
version.mod.patch =

version.minecraft = 1.7.10
version.forge = 10.13.4.1448-1.7.10
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,11 @@ public static enum UpdateStatus {
UNKNOWN, CURRENT, OUTDATED, COMM_ERROR
}

public static final SoftwareVersion modVersion = new SoftwareVersion(
ThermalRecycling.VERSION);
public static final SoftwareVersion modVersion = new SoftwareVersion(ThermalRecycling.VERSION);
public static SoftwareVersion currentVersion = new SoftwareVersion();
public static UpdateStatus status = UpdateStatus.UNKNOWN;

private static final String mcVersion = Loader.instance()
.getMinecraftModContainer().getVersion();
private static final String mcVersion = Loader.instance().getMinecraftModContainer().getVersion();

public static class SoftwareVersion implements Comparable<SoftwareVersion> {

Expand Down Expand Up @@ -113,8 +111,7 @@ public SoftwareVersion(String versionString) {
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
builder.append(this.major).append('.').append(this.minor)
.append('.').append(this.revision);
builder.append(this.major).append('.').append(this.minor).append('.').append(this.revision);
if (this.patch != 0)
builder.append('.').append(this.patch);
if (this.isAlpha)
Expand Down Expand Up @@ -150,8 +147,7 @@ public static void register() {
final NBTTagCompound nbt = new NBTTagCompound();
nbt.setString("curseProjectName", CURSE_PROJECT_NAME);
nbt.setString("curseFilenameParser", MOD_NAME_TEMPLATE);
FMLInterModComms.sendRuntimeMessage(ThermalRecycling.MOD_ID,
"VersionChecker", "addVersionCheck", nbt);
FMLInterModComms.sendRuntimeMessage(ThermalRecycling.MOD_ID, "VersionChecker", "addVersionCheck", nbt);
}

if (ModOptions.getOnlineVersionChecking()) {
Expand All @@ -166,10 +162,9 @@ public void playerLogin(final PlayerLoggedInEvent event) {

if (event.player instanceof EntityPlayer) {
if (status == UpdateStatus.OUTDATED) {
final String msg = StatCollector.translateToLocalFormatted(
"msg.NewVersionAvailable", currentVersion);
IChatComponent component = IChatComponent.Serializer
.func_150699_a(msg);
final String msg = StatCollector.translateToLocalFormatted("msg.NewVersionAvailable.recycling",
ThermalRecycling.MOD_NAME, currentVersion, CURSE_PROJECT_NAME);
IChatComponent component = IChatComponent.Serializer.func_150699_a(msg);
event.player.addChatMessage(component);
}
}
Expand All @@ -188,8 +183,7 @@ private static void versionCheck() {
}

conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty(
"User-Agent",
conn.setRequestProperty("User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)");
conn.connect();
location = conn.getHeaderField("Location");
Expand All @@ -199,8 +193,7 @@ private static void versionCheck() {
throw new NullPointerException();
}

BufferedReader reader = new BufferedReader(new InputStreamReader(
conn.getInputStream()));
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));

String line;
while ((line = reader.readLine()) != null) {
Expand Down Expand Up @@ -240,8 +233,7 @@ public void run() {
}
versionCheck();
count++;
} while (count < VERSION_CHECK_RETRIES
&& status == UpdateStatus.COMM_ERROR);
} while (count < VERSION_CHECK_RETRIES && status == UpdateStatus.COMM_ERROR);

} catch (InterruptedException e) {
e.printStackTrace();
Expand All @@ -252,13 +244,11 @@ public void run() {
ModLog.warn("Version check failed");
break;
case CURRENT:
ModLog.info(
"Thermal Recycling version [%s] is the same or newer than the current version [%s]",
modVersion, currentVersion);
ModLog.info("Thermal Recycling version [%s] is the same or newer than the current version [%s]", modVersion,
currentVersion);
break;
case OUTDATED:
ModLog.warn("Using outdated version [" + modVersion
+ "] for Minecraft " + mcVersion
ModLog.warn("Using outdated version [" + modVersion + "] for Minecraft " + mcVersion
+ ". Consider updating to " + currentVersion + ".");
break;
case UNKNOWN:
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/recycling/lang/de_DE.lang
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ msg.ItemScrapValue.superior=§eScrap Value: §6Hochwertig
# Compost Ingredient Value for lore
msg.ItemCompostIngredientValue.brown=§eCompost: §6Braun
msg.ItemCompostIngredientValue.green=§eCompost: §2Grün

# Version checking strings
msg.NewVersionAvailable.recycling=["�6Update Available: �9[",{"text":"�2%s �ev%s�f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/%s"}},"�9]"]
2 changes: 1 addition & 1 deletion src/main/resources/assets/recycling/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ msg.BookTitle9.name=Better Blocks and Mines
msg.BookTitle9.desc=Rattle your neighbor with skulls!

# Version checking strings
msg.NewVersionAvailable=["§6Update Available: §9[",{"text":"§2Thermal Recycling §ev%s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/229666-thermal-recycling"}},"§9]"]
msg.NewVersionAvailable.recycling=["§6Update Available: §9[",{"text":"§2%s §ev%s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/%s"}},"§9]"]
3 changes: 3 additions & 0 deletions src/main/resources/assets/recycling/lang/fr_FR.lang
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ msg.ItemScrapValue.superior=§eScrap Value: §6Supérieure
# Compost Ingredient Value for lore
msg.ItemCompostIngredientValue.brown=§eComposte: §6Brun
msg.ItemCompostIngredientValue.green=§eComposte: §2Vert

# Version checking strings
msg.NewVersionAvailable.recycling=["�6Update Available: �9[",{"text":"�2%s �ev%s�f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/%s"}},"�9]"]
2 changes: 1 addition & 1 deletion src/main/resources/assets/recycling/lang/nl_BE.lang
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ msg.BookTitle9.name=Beter blokken en mijnen
msg.BookTitle9.desc=Rochel je buur met schedels!

# Version checking strings
msg.NewVersionAvailable=["�6Update Available: �9[",{"text":"�2Thermic Recycling �ev%s�f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/229666-thermal-recycling"}},"�9]"]
msg.NewVersionAvailable.recycling=["�6Update Available: �9[",{"text":"�2%s �ev%s�f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/%s"}},"�9]"]
3 changes: 3 additions & 0 deletions src/main/resources/assets/recycling/lang/pt_BR.lang
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ msg.ItemScrapValue.superior=§eValor como Sucata: §6Superior
# Compost Ingredient Value for lore
msg.ItemCompostIngredientValue.brown=§eComposto: §6Marrom
msg.ItemCompostIngredientValue.green=§eComposto: §2Verde

# Version checking strings
msg.NewVersionAvailable.recycling=["�6Update Available: �9[",{"text":"�2%s �ev%s�f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/%s"}},"�9]"]
97 changes: 50 additions & 47 deletions src/main/resources/assets/recycling/lang/ru_RU.lang
Original file line number Diff line number Diff line change
@@ -1,64 +1,67 @@
#Russian translation by Grom PE [15 Jun 2015]
itemGroup.ThermalRecycling=Thermal Recycling
itemGroup.TagLine=Разделяй и перерабатывай!
itemGroup.TagLine=Раздел�й и перерабатывай!

item.Debris.debris.name=Переработанный мусор
item.RecyclingScrap.poor.name=Хлам
item.RecyclingScrap.standard.name=Лом
item.RecyclingScrap.superior.name=Ценный лом
item.RecyclingScrapBox.poor.name=Коробка хлама
item.RecyclingScrapBox.poor.desc=Кажется, чем-то пахнет
item.RecyclingScrapBox.standard.name=Коробка лома
item.RecyclingScrapBox.standard.desc=Неплохие детали
item.RecyclingScrapBox.superior.name=Коробка ценного лома
item.RecyclingScrapBox.superior.desc=Мечта каждого механика
item.ProcessingCore.decomposition.name=Ядро расщепления (Основн.)
item.ProcessingCore.decomposition_1.name=Ядро расщепления (Усилен.)
item.ProcessingCore.decomposition_2.name=§eЯдро расщепления (Укреплён.)
item.ProcessingCore.decomposition_3.name=§3Ядро расщепления (Резонирующ.)
item.ProcessingCore.decomposition_4.name=§5Ядро расщепления (Эфирн.)
item.ProcessingCore.extraction.name=Ядро извлечения
item.Debris.debris.name=Переработанный му�ор
item.RecyclingScrap.poor.name=Хлам
item.RecyclingScrap.standard.name=Лом
item.RecyclingScrap.superior.name=Ценный лом
item.RecyclingScrapBox.poor.name=Коробка хлама
item.RecyclingScrapBox.poor.desc=Кажет��, чем-то пахнет
item.RecyclingScrapBox.standard.name=Коробка лома
item.RecyclingScrapBox.standard.desc=�еплохие детали
item.RecyclingScrapBox.superior.name=Коробка ценного лома
item.RecyclingScrapBox.superior.desc=Мечта каждого механика
item.ProcessingCore.decomposition.name=Ядро ра�щеплени� (О�новн.)
item.ProcessingCore.decomposition_1.name=Ядро ра�щеплени� (У�илен.)
item.ProcessingCore.decomposition_2.name=§eЯдро ра�щеплени� (Укреплён.)
item.ProcessingCore.decomposition_3.name=§3Ядро ра�щеплени� (Резонирующ.)
item.ProcessingCore.decomposition_4.name=§5Ядро ра�щеплени� (Эфирн.)
item.ProcessingCore.extraction.name=Ядро извлечени�

item.PaperLogMaker.paperlogmaker.name=Макулатуратор
item.Material.paperlog.name=Макулатура
item.Material.worms.name=Горсть червей
item.PaperLogMaker.paperlogmaker.name=Макулатуратор
item.Material.paperlog.name=Макулатура
item.Material.worms.name=Гор�ть червей

tile.PileOfRubble.name=Кучка щебня
tile.FertileLand.name=Удобренная земля
tile.MachineThermalRecycler.name=Термический перерабатыватель
tile.MachineScrapAssessor.name=Оценщик лома
tile.MachineComposter.name=Компостер
tile.MachineVending.name=Торговый автомат
tile.ScrapBlock.scrap.name=Блок мусора
tile.PileOfRubble.name=Кучка щебн�
tile.FertileLand.name=Удобренна� земл�
tile.MachineThermalRecycler.name=Термиче�кий перерабатыватель
tile.MachineScrapAssessor.name=Оценщик лома
tile.MachineComposter.name=Компо�тер
tile.MachineVending.name=Торговый автомат
tile.ScrapBlock.scrap.name=Блок му�ора

msg.MachineVending.adminName=Серверный магазин
msg.MachineVending.adminName=Серверный магазин

# Additional text for Scrap Assessor lore
msg.ScrapPreview.destroy=Уничтожится
msg.ScrapPreview.keep=Останется
msg.ScrapPreview.dust=Раздробится (по возможности)
msg.ScrapPreview.destroy=Уничтожит��
msg.ScrapPreview.keep=О�танет��
msg.ScrapPreview.dust=Раздробит�� (по возможно�ти)

# Machine Status
msg.MachineStatus.idle=Бездействие
msg.MachineStatus.idle=Бездей�твие
msg.MachineStatus.active=%d%%
msg.MachineStatus.jammed=Застрял!
msg.MachineStatus.needMoreResources=Нужно больше ресурсов!
msg.MachineStatus.outOfPower=Обесточен
msg.MachineStatus.needMoreWater=Нужна вода
msg.MachineStatus.cantSeeSky=Нужно открытое небо
msg.MachineStatus.jammed=За�тр�л!
msg.MachineStatus.needMoreResources=�ужно больше ре�ур�ов!
msg.MachineStatus.outOfPower=Обе�точен
msg.MachineStatus.needMoreWater=�ужна вода
msg.MachineStatus.cantSeeSky=�ужно открытое небо

# Achievements
achievement.feelingScrappy=Пора навести порядок!
achievement.feelingScrappy.desc=Сделайте термический перерабатыватель
achievement.doingMyPart=Делаю, что могу
achievement.doingMyPart.desc=Используйте коробку лома
achievement.feelingScrappy=Пора наве�ти пор�док!
achievement.feelingScrappy.desc=Сделайте термиче�кий перерабатыватель
achievement.doingMyPart=Делаю, что могу
achievement.doingMyPart.desc=И�пользуйте коробку лома

# ScrapValue for item lore
msg.ItemScrapValue.none=§eЦенность лома: §7Нет
msg.ItemScrapValue.poor=§eЦенность лома: §fХлам
msg.ItemScrapValue.standard=§eЦенность лома: §9Обычный
msg.ItemScrapValue.superior=§eЦенность лома: §6Ценный
msg.ItemScrapValue.none=§eЦенно�ть лома: §7�ет
msg.ItemScrapValue.poor=§eЦенно�ть лома: §fХлам
msg.ItemScrapValue.standard=§eЦенно�ть лома: §9Обычный
msg.ItemScrapValue.superior=§eЦенно�ть лома: §6Ценный

# Compost Ingredient Value for lore
msg.ItemCompostIngredientValue.brown=§eКомпост: §6Коричневый
msg.ItemCompostIngredientValue.green=§eКомпост: §2Зелёный
msg.ItemCompostIngredientValue.brown=§eКомпо�т: §6Коричневый
msg.ItemCompostIngredientValue.green=§eКомпо�т: §2Зелёный

# Version checking strings
msg.NewVersionAvailable.recycling=["§6Update Available: §9[",{"text":"§2%s §ev%s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"Click for CurseForge Project Page","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/%s"}},"§9]"]
2 changes: 1 addition & 1 deletion src/main/resources/assets/recycling/lang/zh_CN.lang
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ msg.BookTitle9.name=更好的方块更好的挖矿
msg.BookTitle9.desc=Rattle your neighbor with skulls!

# Version checking strings
msg.NewVersionAvailable=["§6有更新可用: §9[",{"text":"§2Thermal Recycling §ev%s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"点击进入CurseForge上的项目页面","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/229666-thermal-recycling"}},"§9]"]
msg.NewVersionAvailable.recycling=["§6有更新可用: §9[",{"text":"§2%s §ev%s§f","color":"gold","hoverEvent":{"action":"show_text","value":{"text":"点击进入CurseForge上的项目页面","color":"aqua"}},"clickEvent":{"action":"open_url","value":"http://minecraft.curseforge.com/mc-mods/%s"}},"§9]"]

0 comments on commit 555081f

Please sign in to comment.