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 Events for Plot Move + Plot Swap #3769

Open
wants to merge 5 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. (+ Swap)
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!

@PierreSchwang
Copy link
Member Author

PierreSchwang commented Aug 11, 2024

Revived this PR (after pushing to the wrong remote). Did a few test cases and it seems to work for me

(Had to force-push sadly)

@PierreSchwang PierreSchwang changed the title Add PlotMoveEvent and PostPlotMoveEvent Add Events for Plot Move + Plot Swap Aug 11, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: PlotMoveEvent
2 participants