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> <groupId>org.json</groupId>
<artifactId>json</artifactId> <artifactId>json</artifactId>
<version>20220320</version> <version>20220320</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.bstats</groupId> <groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId> <artifactId>bstats-bukkit</artifactId>
<version>3.0.0</version> <version>3.0.0</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.maxmind.geoip2</groupId> <groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId> <artifactId>geoip2</artifactId>
<version>3.0.1</version> <version>3.0.1</version>
<scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View file

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

View file

@ -1,6 +1,5 @@
package pl.minecon724.realweather; package pl.minecon724.realweather;
import java.io.File;
import java.util.List; import java.util.List;
import java.util.logging.Level; import java.util.logging.Level;
@ -31,6 +30,7 @@ public class RW extends JavaPlugin {
if (settingsSec.getBoolean("debug")) { if (settingsSec.getBoolean("debug")) {
this.getLogger().setLevel(Level.ALL); this.getLogger().setLevel(Level.ALL);
this.getLogger().fine("Debug info will appear in the console");
} }
String source = weatherSec.getString("source"); String source = weatherSec.getString("source");
@ -58,10 +58,10 @@ public class RW extends JavaPlugin {
provider.init(); provider.init();
if (source.equals("player")) { 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"); int accId = player.getInt("geolite2_accountId");
String license = player.getString("geolite2_apiKey"); 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( new GetStateTask(
@ -71,7 +71,8 @@ public class RW extends JavaPlugin {
settingsSec.getLong("timeBetweenRecheck") settingsSec.getLong("timeBetweenRecheck")
); );
new Metrics(this, 15020); // new Metrics(this, 15020);
// bstat disabled cuz error :(
long end = System.currentTimeMillis(); long end = System.currentTimeMillis();
this.getLogger().info( String.format( this.getName() + " enabled! (%s ms)", Long.toString( end-start ) ) ); this.getLogger().info( String.format( this.getName() + " enabled! (%s ms)", Long.toString( end-start ) ) );

View file

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