Skip to content

Conversation

tintinkung
Copy link
Contributor

from #175

Please see the issue i create for explanations and my system overviews.

Important

I'm unsure how merging this would work.
So the Global Plot-System is pushing for a release which:

  • My plugin requires DiscordSRV, where do we place the instance on that Global server
  • What forum will my webhook be creating thread in? if many build team is included in the Global server
  • Yea it doesn't really make sense for the merge, but the current main branch does not have the idea of global system yet, so it can be merge perfectly, the plugin will be optional to add for server owner anyway.

My suggesting is merging this pr and archive the main branch as 4.X.X, then force push the revamp in.

Leaving the pull request and let the release in ASEAN BTE fork also works.

Changes

The plugin is just an event system, it only register data provider from the plot-system database.
Communications is one-way, the discord plugin only receive events from plot-system and handles it case-by-case.

The plugin cannot modify plot-system data, anything managed by the plugin stays in its isolated database table.

New class: com.alpsbte.plotsystem.utils.DiscordUtil

A singleton to manage all discord event system.

Plugin discordPlugin = PlotSystem.DependencyManager.getDiscordPlotSystemPlugin();
if(discordPlugin != null) {
    DiscordUtil.init(discordPlugin);
}

Example; Submitting a plot:

DiscordUtil.getOpt(plot.getID()).ifPresent(DiscordUtil.PlotEventAction::onPlotApprove)

PlotUtils#abandonPlot

public static boolean abandonPlot(@NotNull AbstractPlot plot) {

Edited for each abandon plot to have scope info for the abandon reason.

public static boolean abandonPlot(@NotNull AbstractPlot plot, @NotNull DiscordUtil.AbandonType type) {

* Proper integrations for discord-plotsystem plugin

* Wrote a wrapper class at `com.alpsbte.plotsystem.utils.DiscordUtil` as a singleton to manage all discord event system

* DiscordUtil is designed to ever be initialized if discord-plotsystem exists in the class path,
  so Plot-System plugin can stay running even if the discord feature isn't installed

(cherry picked from commit 33c69e7)
* Integrate all event system to DiscordUtil class

* New configuration for plot inactivity notification on discord

* Added central sonatype repository to pom.xml
* Apparently legacy date handling is java.sql.Date

* Fix with a safe instance of check
* Typo using the same config path

* Make notification window check clearer
* it may mess up the yaml parser
* Was empty file from plot v5
@Zoriot
Copy link
Member

Zoriot commented Jul 17, 2025

Thanks for your work.
Generally it looks good for me — long term, we want it the other way around. So Plot-System offers a Plugin API which then Plugins can use to interact with the Plot-System.
Also, Discord is such an Important thing for BTE & Plot-System, so maybe it will be integrated in the Plugin itself.
As a Short Term Solution, this can be merged after V5 is out. Will not be merged, most likely, before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants