Giter Club home page Giter Club logo

realworldsync's Introduction

RealWorldSync


Modrinth Setup Docs Issues

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

🔨 Requirements

RealWorldSync requires the following:

  • Minecraft Paper/Purpur/etc. (1.16.5+)
  • Java version 17+

❓ Links

  • Docs — Check the RealWorldSync docs!
  • Discord — Get support, ask questions!
  • bStats — Check out the plugin metrics!
  • GitHub — Check out the plugin source code!
  • Setup — Read the setup instructions!

realworldsync's People

Contributors

nonplayt avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar

realworldsync's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/actions v3
  • actions/upload-artifact v4.3.2
gradle
gradle.properties
  • io.papermc.paper:paper-api 1.20.1-R0.1-SNAPSHOT
  • me.clip:placeholderapi 2.11.5
settings.gradle
build.gradle
  • xyz.jpenilla.run-paper 2.2.3
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.5

  • Check this box to trigger a request for Renovate to run again on this repository

Time sync doesn't work

When I change the time.enabled parameter to true the console starts writing errors every second.

Error:
[11:25:03 WARN]: [RealWorldSync] Plugin RealWorldSync v1.0.0 generated an exception while executing task 45
java.lang.IllegalStateException: TimeSkipEvent may only be triggered synchronously.
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:42) ~[purpur-1.20.1.jar:git-Purpur-2023]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.1.jar:git-Purpur-2023]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.setFullTime(CraftWorld.java:868) ~[purpur-1.20.1.jar:git-Purpur-2023]
at org.bukkit.craftbukkit.v1_20_R1.CraftWorld.setTime(CraftWorld.java:856) ~[purpur-1.20.1.jar:git-Purpur-2023]
at gq.bxteam.realworldsync.world.WorldManager$1.run(WorldManager.java:34) ~[RealWorldSync-1.0.0.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.20.1.jar:git-Purpur-2023]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.20.1.jar:git-Purpur-2023]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.20.1.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

Threaded Weather/Time Updates

Today, the plugin uses the Bukkit scheduler to update the world weather and time using external API calls. This works well when the weather API returns in a timely manner. I've seen a few issues lately across my network where the API calls take a while, and the whole server lags. It took a while to track down, but some thread dumps did the trick.

However, when there's a network interruption, outage, or lag with the HTTP response times, your main thread of the server is left hanging for up to 15 seconds.

The call to the weather API should be done on another thread. Bukkit/Spigot/Paper don't permit you to update in-game attributes (like world or player data) off the main thread. However, this shouldn't be a problem.

  • You can have the craft scheduler periodically run and refresh the data from the API on another thread. It can update plugin-managed variable/map of the weather/time.
  • You have another scheduled task that reads the updated world data from your plugin-managed data structure, and it uses that (on the main thread) to update the world.

With this solution, you'll never have your main thread hanging around waiting for the API call to return.

The plugin doesn't work on Mohist.

When I tried to use this plugin on Mohist, it threw the following error and did not run properly.
[20:31:24 错误]: Error occurred while enabling RealWorldSync v1.1.1 (Is it up to date?) java.lang.NoSuchMethodError: 'java.lang.String org.bukkit.Server.getMinecraftVersion()' at gq.bxteam.realworldsync.RealWorldSync.checkForUpdates(RealWorldSync.java:116) ~[?:?] at gq.bxteam.realworldsync.RealWorldSync.onEnable(RealWorldSync.java:41) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:347) ~[forge-1.20.1-47.2.20-universal.jar%23523!/:?] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:336) ~[forge-1.20.1-47.2.20-universal.jar%23523!/:?] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:482) ~[forge-1.20.1-47.2.20-universal.jar%23523!/:?] at com.rylinaux.plugman.util.BukkitPluginUtil.load(BukkitPluginUtil.java:428) ~[?:?] at com.rylinaux.plugman.util.BukkitPluginUtil.load(BukkitPluginUtil.java:385) ~[?:?] at com.rylinaux.plugman.util.BukkitPluginUtil.reload(BukkitPluginUtil.java:500) ~[?:?] at com.rylinaux.plugman.command.ReloadCommand.execute(ReloadCommand.java:125) ~[?:?] at com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:97) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[forge-1.20.1-47.2.20-universal.jar%23523!/:?] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:147) ~[forge-1.20.1-47.2.20-universal.jar%23523!/:?] at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:885) ~[forge-1.20.1-47.2.20-universal.jar%23523!/:997de31d-ddc9a2dad-d2eba2c8-47.1.79] at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:51) ~[forge-1.20.1-47.2.20-universal.jar%23523!/:?] at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[brigadier-1.20.1.jar%23142!/:?] at net.minecraft.commands.Commands.m_242674_(Commands.java:318) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.m_246958_(ServerGamePacketListenerImpl.java:1835) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$10(ServerGamePacketListenerImpl.java:1799) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.util.thread.BlockableEventLoop.m_18693_(BlockableEventLoop.java:67) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:1029) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:173) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:1012) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:1006) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:991) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:908) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:281) ~[server-1.20.1-20230612.114412-srg.jar%23518!/:?] at java.lang.Thread.run(Thread.java:833) [?:?] [20:31:24 信息]: [RealWorldSync] Disabling RealWorldSync v1.1.1 [20:31:24 信息]: [信息] RealWorldSync: Cancelling all tasks [20:31:24 信息]: [信息] RealWorldSync: Enabling Minecraft default daylight cycle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.