mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-29 03:59:06 +00:00
Simplify command usage + hotload
This commit is contained in:
@@ -20,8 +20,11 @@ package com.volmit.iris.util.decree;
|
||||
|
||||
import com.volmit.iris.core.tools.IrisToolbelt;
|
||||
import com.volmit.iris.engine.framework.Engine;
|
||||
import com.volmit.iris.engine.platform.PlatformChunkGenerator;
|
||||
import com.volmit.iris.util.format.C;
|
||||
import com.volmit.iris.util.plugin.VolmitSender;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface DecreeExecutor {
|
||||
default VolmitSender sender()
|
||||
@@ -29,6 +32,34 @@ public interface DecreeExecutor {
|
||||
return DecreeContext.get();
|
||||
}
|
||||
|
||||
default Player player()
|
||||
{
|
||||
if (sender().isPlayer()) {
|
||||
return sender().player();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
default void message(String string)
|
||||
{
|
||||
sender().sendMessage(string);
|
||||
}
|
||||
|
||||
default void success(String string)
|
||||
{
|
||||
message(C.GREEN + string);
|
||||
}
|
||||
|
||||
default void error(String string)
|
||||
{
|
||||
message(C.RED + string);
|
||||
}
|
||||
|
||||
default void warn(String string)
|
||||
{
|
||||
message(C.YELLOW + string);
|
||||
}
|
||||
|
||||
default Engine engine()
|
||||
{
|
||||
if(sender().isPlayer())
|
||||
@@ -39,6 +70,14 @@ public interface DecreeExecutor {
|
||||
return null;
|
||||
}
|
||||
|
||||
default PlatformChunkGenerator access()
|
||||
{
|
||||
if(sender().isPlayer()) {
|
||||
return IrisToolbelt.access(world());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
default World world()
|
||||
{
|
||||
if (sender().isPlayer()){
|
||||
|
||||
Reference in New Issue
Block a user