mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 10:12:53 +00:00
util function
This commit is contained in:
parent
ba0a95ed26
commit
4f7e25038c
@ -18,11 +18,26 @@
|
||||
|
||||
package com.volmit.iris.util.decree;
|
||||
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
|
||||
public enum DecreeOrigin {
|
||||
PLAYER,
|
||||
CONSOLE,
|
||||
/**
|
||||
* Both the player and the console
|
||||
*/
|
||||
BOTH
|
||||
BOTH;
|
||||
|
||||
/**
|
||||
* Check if the origin is valid for a sender
|
||||
* @param sender The sender to check
|
||||
* @return True if valid for origin
|
||||
*/
|
||||
public boolean validFor(VolmitSender sender){
|
||||
if (sender.isPlayer()){
|
||||
return this.equals(PLAYER) || this.equals(BOTH);
|
||||
} else {
|
||||
return this.equals(CONSOLE) || this.equals(BOTH);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user