This commit is contained in:
Minecon724 2022-04-24 15:25:16 +00:00
parent 15652828ce
commit 4b9db74eee
4 changed files with 10 additions and 7 deletions

View file

@ -27,16 +27,19 @@
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20220320</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

View file

@ -5,7 +5,6 @@ import java.util.List;
import java.util.logging.Logger;
import com.maxmind.geoip2.WebServiceClient;
import com.maxmind.geoip2.model.CityResponse;
import com.maxmind.geoip2.record.Location;
import org.bukkit.Bukkit;

View file

@ -1,6 +1,5 @@
package pl.minecon724.realweather;
import java.io.File;
import java.util.List;
import java.util.logging.Level;
@ -31,6 +30,7 @@ public class RW extends JavaPlugin {
if (settingsSec.getBoolean("debug")) {
this.getLogger().setLevel(Level.ALL);
this.getLogger().fine("Debug info will appear in the console");
}
String source = weatherSec.getString("source");
@ -58,10 +58,10 @@ public class RW extends JavaPlugin {
provider.init();
if (source.equals("player")) {
this.getLogger().info("This product includes GeoLite2 data created by MaxMind, available from https://maxmind.com");
this.getLogger().info("Initializing GeoLite2 by MaxMind because we need it for retrieving players locations.");
int accId = player.getInt("geolite2_accountId");
String license = player.getString("geolite2_apiKey");
client = new WebServiceClient.Builder(accId, license).build();
client = new WebServiceClient.Builder(accId, license).host("geolite.info").build();
}
new GetStateTask(
@ -71,7 +71,8 @@ public class RW extends JavaPlugin {
settingsSec.getLong("timeBetweenRecheck")
);
new Metrics(this, 15020);
// new Metrics(this, 15020);
// bstat disabled cuz error :(
long end = System.currentTimeMillis();
this.getLogger().info( String.format( this.getName() + " enabled! (%s ms)", Long.toString( end-start ) ) );

View file

@ -5,8 +5,8 @@ weather:
- world
- second_world
- third_world
# Point for a static location
# Weather by player's real location soon
# "point" for a static location
# "player" for using the player's location
source: point
point:
latitude: 41.84201