mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
util function
This commit is contained in:
parent
ba0a95ed26
commit
4f7e25038c
@ -18,11 +18,26 @@
|
|||||||
|
|
||||||
package com.volmit.iris.util.decree;
|
package com.volmit.iris.util.decree;
|
||||||
|
|
||||||
|
import com.volmit.iris.util.plugin.VolmitSender;
|
||||||
|
|
||||||
public enum DecreeOrigin {
|
public enum DecreeOrigin {
|
||||||
PLAYER,
|
PLAYER,
|
||||||
CONSOLE,
|
CONSOLE,
|
||||||
/**
|
/**
|
||||||
* Both the player and the 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