Skip to content

Commit

Permalink
Fix CWA EEW and Sichuan EEW info no km letter
Browse files Browse the repository at this point in the history
  • Loading branch information
TenkyuChimata committed Oct 13, 2023
1 parent be8eb2f commit 3de259e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
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.2.3-b1</version>
<version>2.2.3-b2</version>
<packaging>jar</packaging>

<name>MCEEW</name>
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/jp/wolfx/mceew/MCEEW.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void getEewData() {
jmaEewData = json.get("jma_eew").getAsJsonObject();
jmaEqlistData = json.get("jma_eqlist").getAsJsonObject();
scEewData = json.get("sc_eew").getAsJsonObject();
cwaEewData = json.get("cwa_eew").getAsJsonObject();
cwaEewData = json.get("cwb_eew").getAsJsonObject();
EewDataTS = json.get("create_at").getAsString();
}
}
Expand Down Expand Up @@ -293,9 +293,11 @@ private static void scEewExecute(Boolean scEewBoolean) {
String lon = scEewData.get("Longitude").getAsString();
String region = scEewData.get("HypoCenter").getAsString();
String mag = scEewData.get("Magunitude").getAsString();
String depth = "10";
String depth;
if (!scEewData.get("Depth").isJsonNull()) {
depth = scEewData.get("Depth").getAsString();
depth = scEewData.get("Depth").getAsString() + "km";
} else {
depth = "10km";
}
String intensity = String.valueOf(Math.round(Float.parseFloat(scEewData.get("MaxIntensity").getAsString())));
String origin_time = getDate("yyyy-MM-dd HH:mm:ss", time_format, "Asia/Shanghai", scEewData.get("OriginTime").getAsString());
Expand All @@ -304,7 +306,7 @@ private static void scEewExecute(Boolean scEewBoolean) {
Bukkit.getLogger().info("[MCEEW] Sichuan EEW detected.");
}
if (scEewBoolean) {
scEewAction(report_time, origin_time, num, lat, lon, region, mag, depth + "km", getIntensityColor(intensity));
scEewAction(report_time, origin_time, num, lat, lon, region, mag, depth, getIntensityColor(intensity));
}
}
EventID = scEewData.get("EventID").getAsString();
Expand Down

0 comments on commit 3de259e

Please sign in to comment.