mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-29 12:09:07 +00:00
Find + addition to DecreeExecutor
Adds world() to the decree executor
This commit is contained in:
@@ -21,6 +21,7 @@ package com.volmit.iris.util.decree;
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import org.bukkit.World;
|
||||
|
||||
public interface DecreeExecutor {
|
||||
default VolmitSender sender()
|
||||
@@ -38,6 +39,14 @@ public interface DecreeExecutor {
|
||||
return null;
|
||||
}
|
||||
|
||||
default World world()
|
||||
{
|
||||
if (sender().isPlayer()){
|
||||
return sender().player().getWorld();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
default <T> T get(T v, T ifUndefined)
|
||||
{
|
||||
return v == null ? ifUndefined : v;
|
||||
|
||||
Reference in New Issue
Block a user