Skip to content

Conversation

@tintinkung
Copy link
Contributor

FROM #175 W/ ISSUE #176

Important

  • 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

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

* 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 the discord-plotsystem exist in the class path,
  so Plot-System plugin can stay running even if the discord feature isn't installed

* Cherry picked from 33c69e7
Some method path might still be wrong

# Conflicts:
#	src/main/java/com/alpsbte/plotsystem/PlotSystem.java
#	src/main/java/com/alpsbte/plotsystem/commands/plot/CMD_Plot_Abandon.java
#	src/main/java/com/alpsbte/plotsystem/core/system/plot/generator/AbstractPlotGenerator.java
#	src/main/java/com/alpsbte/plotsystem/core/system/plot/utils/PlotUtils.java
#	src/main/java/com/alpsbte/plotsystem/core/system/review/PlotReview.java
#	src/main/resources/plugin.yml
* Using minutesDiff <= 75 may run 3 times a day

* Edited minute-window to 60 which the actual
  windows will be minutesDiff < (60 / 2)

(cherry picked from commit 31c6900)
* make inactivity notification for discord
  configurable in config.yml

* make notification window calculation clearer

(cherry picked from commit 0fda613)
@tintinkung
Copy link
Contributor Author

3rd time the charm

@Zoriot Zoriot added enhancement New feature or request high priority labels Jan 27, 2026
@Zoriot Zoriot linked an issue Jan 27, 2026 that may be closed by this pull request
4 tasks
Copy link
Member

@Zoriot Zoriot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone can dedicate time to it we should instead of implementing a addon api write our own proper api which ensure the same functionality. Which then addons like DiscordPlotSystem can implement.
This approach is very bad to maintain long term - short term I'm open in merging it. Also i don't like that DPS have completly own data at least some parts are duplicated.

}

// Register discord Integration
org.bukkit.plugin.Plugin discordPlugin = DependencyManager.getDiscordIntegration();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no import?

# How many days of inactivity it will take before a claimed plot is automatically abandoned, -2 disables it
inactivity-interval: 14

# How long left (Days) until the plot gets abandon due to inactivity and the system will start pinging owner on discord
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not add options only for (optional) integrations. Either also use it in the plugin or find a way to have a generalized approach and configure it in DiscordPlotSystem

* @see asia.buildtheearth.asean.discord.plotsystem.api.events.AbandonType
*/
public enum AbandonType {
/** @see asia.buildtheearth.asean.discord.plotsystem.api.events.AbandonType#INACTIVE */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports?

@@ -0,0 +1,215 @@
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the License - we now only specify it in the root of the project for clearity

return PlotSystem.getPlugin().getServer().getPluginManager().isPluginEnabled("WorldGuardExtraFlags");
}

public static @Nullable org.bukkit.plugin.Plugin getDiscordIntegration() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import

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.

[Feature] Implementations for Discord integration

2 participants