mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
63 lines
1.3 KiB
Java
63 lines
1.3 KiB
Java
package com.volmit.iris.command;
|
|
|
|
import org.bukkit.World;
|
|
import org.bukkit.entity.Player;
|
|
|
|
import com.volmit.iris.Iris;
|
|
import com.volmit.iris.IrisSettings;
|
|
import com.volmit.iris.gen.IrisTerrainProvider;
|
|
import com.volmit.iris.gen.provisions.ProvisionBukkit;
|
|
import com.volmit.iris.gen.scaffold.IrisWorlds;
|
|
import com.volmit.iris.util.MortarCommand;
|
|
import com.volmit.iris.util.MortarSender;
|
|
|
|
public class CommandIrisStudioHotload extends MortarCommand
|
|
{
|
|
public CommandIrisStudioHotload()
|
|
{
|
|
super("hotload", "hot", "h", "reload");
|
|
setDescription("Force a hotload");
|
|
requiresPermission(Iris.perm.studio);
|
|
setCategory("World");
|
|
}
|
|
|
|
@Override
|
|
public boolean handle(MortarSender sender, String[] args)
|
|
{
|
|
if(!IrisSettings.get().isStudio())
|
|
{
|
|
sender.sendMessage("To use Iris Studio, please enable studio in Iris/settings.json");
|
|
return true;
|
|
}
|
|
|
|
if(sender.isPlayer())
|
|
{
|
|
Player p = sender.player();
|
|
World world = p.getWorld();
|
|
if(!(world.getGenerator() instanceof ProvisionBukkit))
|
|
{
|
|
sender.sendMessage("You must be in an iris world.");
|
|
return true;
|
|
}
|
|
|
|
IrisTerrainProvider g = IrisWorlds.getProvider(world);
|
|
g.onHotload();
|
|
sender.sendMessage("Hotloaded!");
|
|
return true;
|
|
}
|
|
|
|
else
|
|
{
|
|
sender.sendMessage("Players only.");
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
protected String getArgsUsage()
|
|
{
|
|
return "";
|
|
}
|
|
}
|