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 ClaimCreatedEvent and ClaimModifiedEvent #344

Merged
merged 3 commits into from Aug 13, 2018
Merged

Add ClaimCreatedEvent and ClaimModifiedEvent #344

merged 3 commits into from Aug 13, 2018

Conversation

Narimm
Copy link

@Narimm Narimm commented Aug 5, 2018

  1. Claim creation event... this is fired once all the claim creation checks have been passed. It can be cancelled. It contains the claim and the creating player
  2. Claim modification event - this is fired as the claim is modified - it cannot be cancelled. It contains the claim and the modifier...which can be null.

Additional changes

  • The datastores basic claim create event is overloaded to allow us to differentiate between real new claims and modification of claims.
  • Cleaned up the datastore imports..

Use Case:
This could be used so other plugins can hook gp and perform an action if a claim is created or changed. Something as simple as logging claim creations/modifications and deletions.

1. Claim creation event... this is fired once all the claim creation checks have been passed.  It can be cancelled. It contains the claim and the creating player
2. Claim modification event - this is fired as the claim is modified - it cannot be cancelled. It contains the claim and the modifier...which can be null.

Use Case:
This could be used so other plugins can hook gp and perform an action if a claim is created or changed. Something as simple as logging claim creations/modifications and deletions.
RoboMWM
RoboMWM previously approved these changes Aug 5, 2018
Copy link

@RoboMWM RoboMWM left a comment

Choose a reason for hiding this comment

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

Looks good, will pull after the 1.13 PR.

import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import me.ryanhamshire.GriefPrevention.events.ClaimModifyEvent;
import org.bukkit.*;
Copy link

Choose a reason for hiding this comment

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

Can you make your IDE not do this please (wildcard imports)? Thanks.

@RoboMWM RoboMWM changed the title Create 2 new events Add CreateClaimEvent and ClaimModifyEvent Aug 5, 2018
@RoboMWM
Copy link

RoboMWM commented Aug 5, 2018

Only other minor critique is that the event name could be swapped to something more consistent such as ModifyClaimEvent.

1. Claim creation event... this is fired once all the claim creation checks have been passed.  It can be cancelled. It contains the claim and the creating player
2. Claim modification event - this is fired as the claim is modified - it cannot be cancelled. It contains the claim and the modifier...which can be null.

Use Case:
This could be used so other plugins can hook gp and perform an action if a claim is created or changed. Something as simple as logging claim creations/modifications and deletions.
@Narimm
Copy link
Author

Narimm commented Aug 5, 2018

I adjusted the Event name ...but to keep it consistent with existing events I went with ClaimModifiedEvent...
preexisting ClaimDeleteEvent...

@Narimm
Copy link
Author

Narimm commented Aug 5, 2018

So the new ones are

  1. ClaimCreatedEvent
    2.ClaimModifiedEvent
    (Existing)
    ClaimDeletedEvent

@RoboMWM RoboMWM added this to the 16.9 milestone Aug 13, 2018
@RoboMWM RoboMWM changed the title Add CreateClaimEvent and ClaimModifyEvent Add ClaimCreatedEvent and ClaimModifiedEvent Aug 13, 2018
@RoboMWM RoboMWM merged commit 643ad8a into GriefPrevention:master Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants