forked from BigScary/GriefPrevention
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
ClaimTransferEvent #1641
Merged
Merged
ClaimTransferEvent #1641
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/main/java/me/ryanhamshire/GriefPrevention/events/ClaimTransferEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package me.ryanhamshire.GriefPrevention.events; | ||
|
||
import me.ryanhamshire.GriefPrevention.Claim; | ||
import org.bukkit.event.Cancellable; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.HandlerList; | ||
|
||
import java.util.UUID; | ||
|
||
/** | ||
* This Event is thrown when a claim is being transferred. If it is cancelled the claim will not be transferred. | ||
* <p> | ||
* Created by bertek41 on 30/10/2021. | ||
*/ | ||
|
||
public class ClaimTransferEvent extends Event implements Cancellable | ||
{ | ||
|
||
private static final HandlerList handlers = new HandlerList(); | ||
|
||
public static HandlerList getHandlerList() | ||
{ | ||
return handlers; | ||
} | ||
|
||
private final Claim claim; | ||
|
||
private UUID newOwner; | ||
|
||
private boolean cancelled = false; | ||
|
||
public ClaimTransferEvent(Claim claim, UUID newOwner) { | ||
this.claim = claim; | ||
this.newOwner = newOwner; | ||
} | ||
|
||
@Override | ||
public HandlerList getHandlers() | ||
{ | ||
return handlers; | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() | ||
{ | ||
return cancelled; | ||
} | ||
|
||
@Override | ||
public void setCancelled(boolean cancelled) | ||
{ | ||
this.cancelled = cancelled; | ||
} | ||
|
||
/** | ||
* The Claim | ||
* | ||
* @return {@link Claim} | ||
*/ | ||
public Claim getClaim() | ||
{ | ||
return claim; | ||
} | ||
|
||
/** | ||
* New owner of the claim | ||
* | ||
* @return the {@link java.util.UUID} of new owner or null | ||
*/ | ||
public UUID getNewOwner() | ||
{ | ||
return newOwner; | ||
} | ||
|
||
/** | ||
* Sets the new owner of the claim | ||
* | ||
* @param {@link java.util.UUID} newOwner can be null | ||
*/ | ||
public void setNewOwner(UUID newOwner) | ||
{ | ||
this.newOwner = newOwner; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either YYYYMMDD or MMDDYYYY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but in general, no datestamp is really needed, and I can't be bothered to care when imma branch this off at some point anyway.