IntellectualSites / PlotSquared

PlotSquared - Reinventing the plotworld
GNU General Public License v3.0
542 stars 736 forks source link

PlayerClaimPlotEvent not called on /plot auto #3873

Closed nicolube closed 1 year ago

nicolube commented 1 year ago

Server Implementation

Paper

Server Version

1.19.2

Describe the bug

PlayerClaimPlotEvent is not called on /plot auto when successful.

To Reproduce

  1. Registert PlayerClaimPlotEvent
  2. And Log if it is fiered

    @Subscribe public void onPlotAutoClaimPlot(PlayerAutoPlotsChosenEvent e) { Plot plot = e.getPlot(); Bukkit.broadcastMessage("PlayerClaimPlotEvent: " + plot.getId()); }

Expected behaviour

A logged message when /p auto is successful

Screenshots / Videos

First the /p auto Secord /p claim

In the middle I accedently tried to claim an already claimed plot

The cut off text at the top is an PlotDeleteEvent

Screenshot

Error log (if applicable)

None

Plot Debugpaste

https://athion.net/ISPaster/paste/view/c9ada49c5be04ae9a94eb37a119381e2

PlotSquared Version

PlotSquared-6.10.4-SNAPSHOT (Build from Monday)

Checklist

Anything else?

I'm using an self build of PlotSquared because I'm building an addon for MultiPaper that syncs the plot data between the servers.

NotMyFault commented 1 year ago

These kinds of events relate to the class instantiating the event, not the actual event they are targeting. In this case, you'll want to listen on PlayerAutoPlotEvent for /plot auto. PlayerClaimPlotEvent does only fire if a plot is claimed through /plot claim, not through auto, if it's bought, through transfer, etc.; see above for the reasoning.