Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
modify some things
Browse files Browse the repository at this point in the history
  • Loading branch information
NONPLAYT committed Aug 1, 2023
1 parent 0f712ec commit 59af65b
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 17 deletions.
Empty file removed .github/workflows/.gitkeep
Empty file.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
name: RealWorldSync Dev Artifacts
path: "build/libs/RealWorldSync-*.jar"
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!--suppress ALL -->
<div align="center">
<h1>RealWorldSync</h1>
<a href="https://github.com/BX-Team/RealWorldSync/actions/workflows/build.yml">
<img src="https://img.shields.io/github/actions/workflow/status/BX-Team/RealWorldSync/build.yml?branch=master&logo=github"/>
</a>
<a href="https://discord.gg/p7cxhw7E2M">
<img src="https://img.shields.io/discord/931595732752953375.svg?label=&logo=discord&logoColor=fff&color=7389D8&labelColor=6A7EC2" />
</a>
<br>
<b>
<a href="https://modrinth.com/plugin/rws">Modrinth</a>
</b> —
<b>
<a href="">Setup</a>
</b>
<b> —
<a href="https://github.com/BX-Team/RealWorldSync/wiki">Docs</a>
</b> —
<b>
<a href="https://github.com/BX-Team/RealWorldSync/issues">Issues</a>
</b>
</div>

**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!
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0
1.0.0
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
group = gq.bxteam
version = 0.1.0
# 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
4 changes: 2 additions & 2 deletions src/main/java/gq/bxteam/realworldsync/RealWorldSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/gq/bxteam/realworldsync/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 59af65b

Please sign in to comment.