Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3caf8b23e2 | ||
|
f2202b43f1 | ||
|
66350d3b23 | ||
|
b9a1451bc9 | ||
|
040230ace1 | ||
|
b90d4c6599 |
12
README.md
12
README.md
@@ -1,2 +1,14 @@
|
||||
# RealTimeWeather [](https://app.travis-ci.com/Jack1424/RealTimeWeather)
|
||||
A lightweight Minecraft Java server plugin that allows you to sync your server's time and weather with the real world
|
||||
|
||||
**Current Features:**
|
||||
- Lightweight
|
||||
- Constant time syncing
|
||||
- Weather syncing (rain and thunder)
|
||||
|
||||
**Upcoming Features:**
|
||||
- [ ] Use WeatherPlusAPI (more weather states)
|
||||
- [ ] Support for more Minecraft verions
|
||||
|
||||
## Contributions
|
||||
I'm open to any help/ideas that you have. Just open an issue or a pull request and I'll be sure to look at it as soon as I can. Builds with Gradle.
|
||||
|
@@ -1,9 +1,10 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
||||
}
|
||||
|
||||
group = 'io.github.Jack1424'
|
||||
version = '1.0.0'
|
||||
version = '1.1.0'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -18,9 +19,14 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.bstats:bstats-bukkit:3.0.0")
|
||||
compileOnly 'io.papermc.paper:paper-api:1.19.2-R0.1-SNAPSHOT'
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
relocate('org.bstats', 'io.github.jack1424.realtimeweather')
|
||||
}
|
||||
|
||||
def targetJavaVersion = 17
|
||||
java {
|
||||
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package io.github.jack1424.realtimeweather;
|
||||
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bukkit.GameRule;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.event.EventHandler;
|
||||
@@ -45,6 +47,11 @@ public final class RealTimeWeather extends JavaPlugin implements Listener {
|
||||
|
||||
getServer().getPluginManager().registerEvents(this, this);
|
||||
|
||||
debug("Enabling metrics...");
|
||||
Metrics metrics = new Metrics(this, 16709);
|
||||
metrics.addCustomChart(new SimplePie("weather_sync_enabled", () -> String.valueOf(weatherEnabled)));
|
||||
metrics.addCustomChart(new SimplePie("time_sync_enabled", () -> String.valueOf(timeEnabled)));
|
||||
|
||||
logger.info("Started!");
|
||||
}
|
||||
|
||||
@@ -54,7 +61,9 @@ public final class RealTimeWeather extends JavaPlugin implements Listener {
|
||||
if (world.getEnvironment().equals(World.Environment.NORMAL)) {
|
||||
debug("Re-enabling normal daylight and weather cycles...");
|
||||
|
||||
if (timeEnabled)
|
||||
world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true);
|
||||
if (weatherEnabled)
|
||||
world.setGameRule(GameRule.DO_WEATHER_CYCLE, true);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user