6 Commits

Author SHA1 Message Date
Jack Fitch
3caf8b23e2 bump to 1.1.0 2022-10-22 11:56:35 -04:00
Jack Fitch
f2202b43f1 Merge remote-tracking branch 'origin/master' 2022-10-22 11:56:10 -04:00
Jack Fitch
66350d3b23 add bStats 2022-10-22 11:55:44 -04:00
Jack Fitch
b9a1451bc9 only reset game rules if needed 2022-10-22 11:55:22 -04:00
Jack
040230ace1 update README 2022-10-22 11:52:24 -04:00
Jack
b90d4c6599 update README 2022-10-21 23:55:16 -04:00
3 changed files with 31 additions and 4 deletions

View File

@@ -1,2 +1,14 @@
# RealTimeWeather [![Build Status](https://app.travis-ci.com/Jack1424/RealTimeWeather.svg?branch=master)](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
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.

View File

@@ -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)

View File

@@ -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,8 +61,10 @@ public final class RealTimeWeather extends JavaPlugin implements Listener {
if (world.getEnvironment().equals(World.Environment.NORMAL)) {
debug("Re-enabling normal daylight and weather cycles...");
world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true);
world.setGameRule(GameRule.DO_WEATHER_CYCLE, true);
if (timeEnabled)
world.setGameRule(GameRule.DO_DAYLIGHT_CYCLE, true);
if (weatherEnabled)
world.setGameRule(GameRule.DO_WEATHER_CYCLE, true);
}
logger.info("Stopping...");