From 2cc7701d061f19a65c53a0891fe5fb23b99f1baa Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 11 Jun 2022 09:09:01 +0000 Subject: [PATCH] am --- src/main/java/pl/minecon724/realweather/GetStateTask.java | 2 +- src/main/java/pl/minecon724/realweather/MapUtils.java | 2 +- src/main/java/pl/minecon724/realweather/RW.java | 1 + .../pl/minecon724/realweather/{ => thirdparty}/Metrics.java | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) rename src/main/java/pl/minecon724/realweather/{ => thirdparty}/Metrics.java (99%) diff --git a/src/main/java/pl/minecon724/realweather/GetStateTask.java b/src/main/java/pl/minecon724/realweather/GetStateTask.java index 7767759..06a69b2 100644 --- a/src/main/java/pl/minecon724/realweather/GetStateTask.java +++ b/src/main/java/pl/minecon724/realweather/GetStateTask.java @@ -60,7 +60,7 @@ public class GetStateTask extends BukkitRunnable { @Override public void run() { - logger.info("Refreshing weather by " + source); + if (debug) logger.info("Refreshing weather by " + source); if (source.equals("point")) { State state = provider.request_state(pointLatitude, pointLongitude); if (debug) logger.info(String.format("Provider returned state %s %s (%s)", state.condition.name(), state.level.name(), state.simple.name())); diff --git a/src/main/java/pl/minecon724/realweather/MapUtils.java b/src/main/java/pl/minecon724/realweather/MapUtils.java index 97cf740..615249b 100644 --- a/src/main/java/pl/minecon724/realweather/MapUtils.java +++ b/src/main/java/pl/minecon724/realweather/MapUtils.java @@ -10,7 +10,7 @@ public class MapUtils { public double[] playerPosAsCoords(Location loc, double scaleLat, double scaleLon, int onExceed) { double[] out = new double[2]; out[0] = loc.getX() * scaleLon; - out[1] = loc.getZ() * scaleLat; + out[1] = -loc.getZ() * scaleLat; if (onExceed == 1) { out[0] = Math.max(-180.0, Math.min(180.0, out[0])); out[1] = Math.max(-90.0, Math.min(90.0, out[1])); diff --git a/src/main/java/pl/minecon724/realweather/RW.java b/src/main/java/pl/minecon724/realweather/RW.java index 422f860..36b8184 100644 --- a/src/main/java/pl/minecon724/realweather/RW.java +++ b/src/main/java/pl/minecon724/realweather/RW.java @@ -10,6 +10,7 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.plugin.java.JavaPlugin; import pl.minecon724.realweather.provider.OpenWeatherMapProvider; +import pl.minecon724.thirdparty.Metrics; public class RW extends JavaPlugin { FileConfiguration config; diff --git a/src/main/java/pl/minecon724/realweather/Metrics.java b/src/main/java/pl/minecon724/realweather/thirdparty/Metrics.java similarity index 99% rename from src/main/java/pl/minecon724/realweather/Metrics.java rename to src/main/java/pl/minecon724/realweather/thirdparty/Metrics.java index 9940aa2..9754de4 100644 --- a/src/main/java/pl/minecon724/realweather/Metrics.java +++ b/src/main/java/pl/minecon724/realweather/thirdparty/Metrics.java @@ -12,7 +12,7 @@ * * Violations will result in a ban of your plugin and account from bStats. */ -package pl.minecon724.realweather; +package pl.minecon724.realweather.thirdparty; import java.io.BufferedReader; import java.io.ByteArrayOutputStream;