Skip to content

Commit

Permalink
Add Max intensity for CWA EEW
Browse files Browse the repository at this point in the history
  • Loading branch information
TenkyuChimata committed Apr 3, 2024
1 parent 7680aa2 commit 4a358a6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ A real-time Earthquake Early Warning(EEW) plugin for Minecraft Server.
![2.png](https://s2.loli.net/2024/02/29/G9EjJDSUtwyVgMQ.png)
![3.png](https://s2.loli.net/2024/02/29/kUsoMQPlBz98DcW.png)
![4.png](https://s2.loli.net/2024/02/29/ncFAuWD4wEsqIah.png)
![5.png](https://s2.loli.net/2024/04/03/prm5fZTesJn7bcj.png)
![5.png](https://s2.loli.net/2024/04/03/QltcV4RZfe8kwIm.png)
![6.png](https://s2.loli.net/2024/02/29/OSGKuyq9zE8ChTY.png)
![7.png](https://s2.loli.net/2024/02/29/tuXgnVqkrxQoYGJ.png)

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>jp.wolfx</groupId>
<artifactId>MCEEW</artifactId>
<version>2.4.1</version>
<version>2.4.2</version>
<packaging>jar</packaging>

<name>MCEEW</name>
Expand Down
17 changes: 11 additions & 6 deletions src/main/java/jp/wolfx/mceew/MCEEW.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,9 @@ private static void eewTest(int flag) {
String region = "花蓮縣壽豐鄉";
String mag = "6.8";
String depth = "20km";
String shindo = "6弱";
String origin_time = getDate("yyyy-MM-dd HH:mm:ss", time_format, "Asia/Shanghai", origin_time_str);
cwaEewAction(report_time, origin_time, num, lat, lon, region, mag, depth);
cwaEewAction(report_time, origin_time, num, lat, lon, region, mag, depth, getShindoColor(shindo));
} else {
String flags = "予報";
String origin_time_str = "2024/02/29 18:35:38";
Expand Down Expand Up @@ -464,8 +465,9 @@ private static void cwaEewExecute(JsonObject cwaEewData) {
String region = cwaEewData.get("HypoCenter").getAsString();
String mag = cwaEewData.get("Magunitude").getAsString();
String depth = cwaEewData.get("Depth").getAsString() + "km";
String shindo = cwaEewData.get("MaxIntensity").getAsString();
String origin_time = getDate("yyyy-MM-dd HH:mm:ss", time_format, "Asia/Shanghai", cwaEewData.get("OriginTime").getAsString());
cwaEewAction(report_time, origin_time, num, lat, lon, region, mag, depth);
cwaEewAction(report_time, origin_time, num, lat, lon, region, mag, depth, getShindoColor(shindo));
}

private static void getEewInfo(Boolean flag, CommandSender sender) {
Expand Down Expand Up @@ -695,7 +697,7 @@ private static void fjEewAction(String report_time, String origin_time, String n
}
}

private static void cwaEewAction(String report_time, String origin_time, String num, String lat, String lon, String region, String mag, String depth) {
private static void cwaEewAction(String report_time, String origin_time, String num, String lat, String lon, String region, String mag, String depth, String shindo) {
if (broadcast_bool) {
Bukkit.broadcastMessage(
cwa_broadcast_message.
Expand All @@ -706,7 +708,8 @@ private static void cwaEewAction(String report_time, String origin_time, String
replaceAll("%lon%", lon).
replaceAll("%region%", region).
replaceAll("%mag%", mag).
replaceAll("%depth%", depth)
replaceAll("%depth%", depth).
replaceAll("%shindo%", shindo)
);
}
if (title_bool) {
Expand All @@ -720,7 +723,8 @@ private static void cwaEewAction(String report_time, String origin_time, String
replaceAll("%lon%", lon).
replaceAll("%region%", region).
replaceAll("%mag%", mag).
replaceAll("%depth%", depth),
replaceAll("%depth%", depth).
replaceAll("%shindo%", shindo),
cwa_subtitle_message.
replaceAll("%report_time%", report_time).
replaceAll("%origin_time%", origin_time).
Expand All @@ -729,7 +733,8 @@ private static void cwaEewAction(String report_time, String origin_time, String
replaceAll("%lon%", lon).
replaceAll("%region%", region).
replaceAll("%mag%", mag).
replaceAll("%depth%", depth),
replaceAll("%depth%", depth).
replaceAll("%shindo%", shindo),
-1, -1, -1
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Message:
subtitle: "&e%region%发生芮氏規模%mag%地震"
# Set the Taiwan CWA EEW message format
Cwa:
broadcast: "&c台灣地震預警 | 第%num%報\n &e%origin_time% &f發生\n &f震央: &e%region% (北緯: &e%lat%度 東經: &e%lon%度)\n &f規模: &e%mag%\n &f深度: &e%depth%\n &f更新時間: &e%report_time%"
broadcast: "&c台灣地震預警 | 第%num%報\n &e%origin_time% &f發生\n &f震央: &e%region% (北緯: &e%lat%度 東經: &e%lon%度)\n &f規模: &e%mag%\n &f深度: &e%depth%\n &f最大震度: &r%shindo%\n &f更新時間: &e%report_time%"
title: "&c台灣地震預警"
subtitle: "&e%region%发生芮氏規模%mag%地震"

Expand Down

0 comments on commit 4a358a6

Please sign in to comment.