diff --git a/.github/workflows/.gitkeep b/.github/workflows/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1076a98 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +# Builds the project with Gradle and uploads to GitHub artifacts. +name: Java CI with Gradle + +on: + push: + +permissions: + contents: read + checks: write + +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.commits[0].message, '[ci-skip]')" + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: gradle + - name: Make Gradlew executable + run: chmod +x ./gradlew + - name: Build with Gradle + uses: gradle/gradle-build-action@v2 + with: + arguments: build + - name: Upload RealWorldSync + uses: actions/upload-artifact@v3.1.2 + with: + name: RealWorldSync Dev Artifacts + path: "build/libs/RealWorldSync-*.jar" \ No newline at end of file diff --git a/README.md b/README.md index e69de29..e859ad8 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,47 @@ + +
+ +**RealWorldSync (RWS)** is a simple and lightweight plugin that allows you to sync the time and weather of your server with any location(s) in the real world. + +### 🤖 Features +- Time synchronization with any timezone of the world +- Weather synchronization with any location in the world +- Customizable update times for weather and time +- PlaceholderAPI support +- HEX colors support (MiniMessage) +- Lightweight and fast :) + +### 🔨 Requirements +RealWorldSync requires the following: + +- **Minecraft Paper/Purpur/etc. (1.16.5+)** +- **Java version 17+** + +### ❓ Links + +- **[Docs](https://github.com/BX-Team/RealWorldSync/wiki)** — Check the RealWorldSync docs! +- **[Discord](https://discord.gg/p7cxhw7E2M)** — Get support, ask questions! +- **[bStats](https://bstats.org/plugin/bukkit/RealWorldSync/19076)** — Check out the plugin metrics! +- **[GitHub](https://github.com/BX-Team/RealWorldSync)** — Check out the plugin source code! +- **Setup** — Read the setup instructions! \ No newline at end of file diff --git a/VERSION b/VERSION index 6c6aa7c..afaf360 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0 \ No newline at end of file +1.0.0 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 35533c4..e2ff819 100644 --- a/build.gradle +++ b/build.gradle @@ -21,8 +21,8 @@ repositories { } dependencies { - compileOnly "io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT" - compileOnly "me.clip:placeholderapi:2.11.3" + compileOnly "io.papermc.paper:paper-api:${project.paper_api}" + compileOnly "me.clip:placeholderapi:${project.placeholder_api}" } def targetJavaVersion = 17 diff --git a/gradle.properties b/gradle.properties index a53ddef..02cd027 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,11 @@ -group = gq.bxteam -version = 0.1.0 \ No newline at end of file +# Gradle daemon options +org.gradle.jvmargs=-Xmx1G +org.gradle.parallel=true + +# Plugin properties +group=gq.bxteam +version=1.0.0 + +# Dependencies +paper_api=1.20.1-R0.1-SNAPSHOT +placeholder_api=2.11.3 \ No newline at end of file diff --git a/src/main/java/gq/bxteam/realworldsync/RealWorldSync.java b/src/main/java/gq/bxteam/realworldsync/RealWorldSync.java index 088888e..b699c4c 100644 --- a/src/main/java/gq/bxteam/realworldsync/RealWorldSync.java +++ b/src/main/java/gq/bxteam/realworldsync/RealWorldSync.java @@ -31,14 +31,14 @@ public void onEnable() { getCommand("rws").setTabCompleter(new Commands()); // Check for updates - if (Config.check_for_updates) { + if (Config.opt_check_for_updates) { if (!UpdateChecker.fetchVersionFromGithub("https://raw.githubusercontent.com/BX-Team/RealWorldSync/master/VERSION", RealWorldSync.getPlugin().getDescription().getVersion())) { LogUtil.sendConsoleLog("The new update of RealWorldSync was found! We recommend to update here: https://modrinth.com/plugin/rws", LogType.WARN); } } // Metrics initialize - if (Config.enable_metrics) { + if (Config.opt_enable_metrics) { LogUtil.sendConsoleLog("&aEnabling metrics", LogType.INFO); Metrics metrics = new Metrics(this, 19076); metrics.addCustomChart(new Metrics.SimplePie("time_sync_enabled", () -> String.valueOf(Config.time_enabled))); diff --git a/src/main/java/gq/bxteam/realworldsync/config/Config.java b/src/main/java/gq/bxteam/realworldsync/config/Config.java index 63c2e54..575ca5e 100644 --- a/src/main/java/gq/bxteam/realworldsync/config/Config.java +++ b/src/main/java/gq/bxteam/realworldsync/config/Config.java @@ -16,8 +16,8 @@ public class Config { private static final YamlConfiguration cfg = new YamlConfiguration(); - public static boolean check_for_updates; - public static boolean enable_metrics; + public static boolean opt_check_for_updates; + public static boolean opt_enable_metrics; public static boolean time_enabled; public static String time_world; public static int time_update; @@ -41,8 +41,8 @@ public static void setupConfig() { } } - Config.check_for_updates = cfg.getBoolean("check-for-updates"); - Config.enable_metrics = cfg.getBoolean("enable-metrics"); + Config.opt_check_for_updates = cfg.getBoolean("options.check-for-updates"); + Config.opt_enable_metrics = cfg.getBoolean("options.enable-metrics"); Config.time_enabled = cfg.getBoolean("time.enabled"); Config.time_world = cfg.getString("time.world"); diff --git a/src/main/java/gq/bxteam/realworldsync/world/WorldManager.java b/src/main/java/gq/bxteam/realworldsync/world/WorldManager.java index 34b0ab4..3529ce2 100644 --- a/src/main/java/gq/bxteam/realworldsync/world/WorldManager.java +++ b/src/main/java/gq/bxteam/realworldsync/world/WorldManager.java @@ -68,7 +68,7 @@ public void run() { LogUtil.sendConsoleLog("There was a problem getting the weather data", LogType.ERROR); } } - }.runTaskTimerAsynchronously(RealWorldSync.getPlugin(), 0L, Config.time_update); + }.runTaskTimerAsynchronously(RealWorldSync.getPlugin(), 0L, Config.weather_update); } public static void enableDaylightCycle() { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index a9a62ed..2b6beb7 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -5,11 +5,13 @@ # ██║░░██║███████╗██║░░██║███████╗░░╚██╔╝░╚██╔╝░╚█████╔╝██║░░██║███████╗██████╔╝██████╔╝░░░██║░░░██║░╚███║╚█████╔╝ # ╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝╚══════╝░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚═╝╚══════╝╚═════╝░╚═════╝░░░░╚═╝░░░╚═╝░░╚══╝░╚════╝░ +# Wiki: https://github.com/BX-Team/RealWorldSync/wiki # Discord server: https://discord.gg/p7cxhw7E2M # Modrinth: https://modrinth.com/plugin/rws -check-for-updates: true -enable-metrics: true +options: + check-for-updates: true + enable-metrics: true time: enabled: false update-interval: 20 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 8f17f0c..9765158 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -10,12 +10,12 @@ description: Synchronizes time and weather from the real world to the game website: https://modrinth.com/plugin/rws commands: rws: - aliases: [rws, realworldsync, world, worldsync] + aliases: [rws, realworldsync, timesync] description: Main command permissions: rws.user: - description: Default user command + description: Default user commands default: true rws.admin: - description: Admin command + description: Gives access to admin command default: op