mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Reload config command
This commit is contained in:
parent
d67596117f
commit
564f02b188
@ -179,4 +179,12 @@ public class IrisSettings
|
||||
|
||||
return settings;
|
||||
}
|
||||
|
||||
public static void invalidate()
|
||||
{
|
||||
synchronized(settings)
|
||||
{
|
||||
settings = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
32
src/main/java/com/volmit/iris/command/CommandIrisReload.java
Normal file
32
src/main/java/com/volmit/iris/command/CommandIrisReload.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisReload extends MortarCommand
|
||||
{
|
||||
public CommandIrisReload()
|
||||
{
|
||||
super("reload", "rld");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setDescription("Reload configs");
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
IrisSettings.invalidate();
|
||||
IrisSettings.get();
|
||||
sender.sendMessage("settings.json Reloaded");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
return "<name> [-t/--trim]";
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user