Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PlotMoveEvent and PostPlotMoveEvent #3769

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

PierreSchwang
Copy link
Member

@PierreSchwang PierreSchwang commented Aug 12, 2022

Overview

Fixes #3692

Description

Adds a cancellable PlotMoveEvent and informational PostPlotMoveEvent.
Found no fitting case for handling the FORCE result, therefor marked that as not supported (just supporting DENY and ACCEPT).

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

@PierreSchwang PierreSchwang requested a review from a team as a code owner August 12, 2022 18:44
@github-actions github-actions bot added the Feature This PR proposes a new feature label Aug 12, 2022
@PierreSchwang
Copy link
Member Author

Validated the functionality of this change using a simple addon plugin:

public class TestAddonPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        new PlotAPI().registerListener(new Object() {

            @Subscribe
            public void onPlotMove(PlotMoveEvent event) {
                event.setEventResult(Result.DENY);
                System.out.println("cancelled");
            }

            @Subscribe
            public void onPostPlotMove(PostPlotMoveEvent event) {
                System.out.println("Plot was moved");
            }

        });
    }
}

The FORCE result may be used to move the plot to occupied places as well? Opinions about that @IntellectualSites/plotsquared-team?

@dordsor21
Copy link
Member

The destination of the move should be able to be changed in the event. Also, the FORCE result needs to be implemented (the event call needs to be moved further up)

I'd also say that a PlotSwapEvent should be added as the two commands are very similar

Copy link
Member

@dordsor21 dordsor21 left a comment

Choose a reason for hiding this comment

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

See above. Requesting (now) to give the label

@github-actions
Copy link

Please take a moment and address the merge conflicts of your pull request. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature This PR proposes a new feature unresolved-merge-conflict
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: PlotMoveEvent
2 participants