9
0
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:
CocoTheOwner
2021-08-14 11:29:24 +02:00
parent cf67d58236
commit 10b2593389
2 changed files with 51 additions and 0 deletions

View File

@@ -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;