Skip to content

Commit

Permalink
[U] 1.2.0-dev12
Browse files Browse the repository at this point in the history
  • Loading branch information
ClayCoffee committed Jun 26, 2020
1 parent 500f72c commit b23a8bf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main/java/club/claycoffee/ClayTech/ClayTech.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ public void onEnable() {
currentLangYML.saveCustomConfig();
currentLangYML.reloadCustomConfig();
switch (version) {
case "v1_16_R1":
break;
case "v1_15_R1":
break;
case "v1_14_R1":
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/club/claycoffee/ClayTech/ClayTechUpdater.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package club.claycoffee.ClayTech;

import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -49,6 +50,11 @@ public void run() {
continue;
} else if (!ja.get(i).getAsJsonObject().get("tag_name").getAsString()
.equalsIgnoreCase(plugin.getPluginVersion())) {
if (new File(plugin.getServer().getUpdateFolder().replaceAll("update", "plugins"),
ja.get(i).getAsJsonObject().get("assets").getAsJsonArray().get(0)
.getAsJsonObject().get("name").getAsString()).exists())
return;

downloadURL = ja.get(i).getAsJsonObject().get("assets").getAsJsonArray().get(0)
.getAsJsonObject().get("browser_download_url").getAsString();
if (!FileDownloader.updateFunc(downloadURL,
Expand All @@ -73,6 +79,10 @@ public void run() {
if (ja.get(0).getAsJsonObject().get("prerelease").getAsBoolean()) {
if (!ja.get(0).getAsJsonObject().get("tag_name").getAsString()
.equalsIgnoreCase(plugin.getPluginVersion())) {
if (new File(plugin.getServer().getUpdateFolder().replaceAll("update", "plugins"),
ja.get(0).getAsJsonObject().get("assets").getAsJsonArray().get(0)
.getAsJsonObject().get("name").getAsString()).exists())
return;
downloadURL = ja.get(0).getAsJsonObject().get("assets").getAsJsonArray().get(0)
.getAsJsonObject().get("browser_download_url").getAsString();
// 开始下载
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/en-GB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ General:
Wash_Message: "&6Completed!"
Cant_Wash_Message: "&cYou need a water bucket to do this."
Before_115: "&cYour server api version is before 1.15,the plugin also can run, but might cause some items can't register."
Not_compatible: "&cSorry.The plugin doesn't compatible your server version.Supported Server Version: 1.13.x, 1.14.x, 1.15.x.Please upgrade your server!"
Not_compatible: "&cSorry.The plugin doesn't compatible your server version.Supported Server Version: 1.13.x, 1.14.x, 1.15.x, 1.16.x.Please upgrade your server!"
TNT_EXPLOSION_CREATER_WAIT: "&aTNT will place 5 seconds later..."
TNT_EXPLOSION_CREATER_NO_TNT: "&cThere's no TNT in your inventory."
TNT_EXPLOSION_CREATER_SUCCESS: "&aTNT exploded successfully."
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ General:
Wash_Message: "&6Completed!"
Cant_Wash_Message: "&cYou need a water bucket to do this."
Before_115: "&cYour server api version is before 1.15,the plugin also can run, but might cause some items can't register."
Not_compatible: "&cSorry.The plugin doesn't compatible your server version.Supported Server Version: 1.13.x, 1.14.x, 1.15.x.Please upgrade your server!"
Not_compatible: "&cSorry.The plugin doesn't compatible your server version.Supported Server Version: 1.13.x, 1.14.x, 1.15.x, 1.16.x.Please upgrade your server!"
TNT_EXPLOSION_CREATER_WAIT: "&aTNT will place 5 seconds later..."
TNT_EXPLOSION_CREATER_NO_TNT: "&cThere's no TNT in your inventory."
TNT_EXPLOSION_CREATER_SUCCESS: "&aTNT exploded successfully."
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ General:
Wash_Message: "&6清洗完毕!!"
Cant_Wash_Message: "&c无法清洗!你没有水桶!"
Before_115: "&c检测到您的服务器运行在1.15版本以下,可能导致有的物品无法注册,但仍可正常运行本插件."
Not_compatible: "&c对不起,本插件仅限1.13.x,1.14.x,1.15.x的服务器使用!请尽快升级您的服务器.."
Not_compatible: "&c对不起,本插件仅限1.13.x,1.14.x,1.15.x,1.16.x的服务器使用!请尽快升级您的服务器.."
TNT_EXPLOSION_CREATER_WAIT: "&aTNT将在5秒钟后放置。 请尽快逃离,避免受到伤害。"
TNT_EXPLOSION_CREATER_NO_TNT: "&c您的背包里没有TNT,无法放置!"
TNT_EXPLOSION_CREATER_SUCCESS: "&aTNT成功爆炸。"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/zh-TW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ General:
Wash_Message: "&6清洗完畢!!"
Cant_Wash_Message: "&c無法清洗!妳沒有水桶!"
Before_115: "&c檢測到您的伺服器運行在1.15版本以下,可能導致有的物品無法註冊,但仍可正常運行本插件."
Not_compatible: "&c對不起,本挿件僅限1.13.x,1.14.x,1.15.x的伺服器使用!請儘快陞級您的伺服器.."
Not_compatible: "&c對不起,本挿件僅限1.13.x,1.14.x,1.15.x,1.16.x的伺服器使用!請儘快陞級您的伺服器.."
TNT_EXPLOSION_CREATER_WAIT: "&aTNT將在5秒鐘後放置。 請盡快逃離,避免受到傷害。"
TNT_EXPLOSION_CREATER_NO_TNT: "&c您的背包裏沒有TNT,無法放置!"
TNT_EXPLOSION_CREATER_SUCCESS: "&aTNT成功爆炸。"
Expand Down

0 comments on commit b23a8bf

Please sign in to comment.