mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Commands & Settings
This commit is contained in:
parent
b158ea9e78
commit
ef6036a7d0
@ -17,12 +17,26 @@ public class IrisHotloadManager
|
||||
|
||||
public IrisHotloadManager()
|
||||
{
|
||||
w = new FolderWatcher(Iris.instance.getDataFolder("packs"));
|
||||
if(!IrisSettings.get().studio)
|
||||
{
|
||||
w = null;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
w = new FolderWatcher(Iris.instance.getDataFolder("packs"));
|
||||
}
|
||||
|
||||
latch = new ChronoLatch(3000);
|
||||
}
|
||||
|
||||
public void check(IrisContext ch)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(!latch.flip())
|
||||
{
|
||||
return;
|
||||
@ -155,9 +169,4 @@ public class IrisHotloadManager
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void track(File file)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ import com.volmit.iris.util.IO;
|
||||
import com.volmit.iris.util.JSONException;
|
||||
import com.volmit.iris.util.JSONObject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class IrisSettings
|
||||
{
|
||||
public static transient IrisSettings settings;
|
||||
@ -35,8 +38,12 @@ public class IrisSettings
|
||||
public boolean sharedCaching = true;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Allows configs to be changed and hotloaded without reloading.")
|
||||
public boolean hotloading = true;
|
||||
@Desc("Allows Iris to use studio commands & design worlds.")
|
||||
public boolean studio = false;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Allows iris to launch guis through the server process. Useful for local development.")
|
||||
public boolean useServerLaunchedGuis = true;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("When using studio open or create, open the codeworkspace automatically.")
|
||||
|
@ -7,20 +7,32 @@ import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIris extends MortarCommand
|
||||
{
|
||||
@Command
|
||||
private CommandIrisCreate create;
|
||||
|
||||
@Command
|
||||
private CommandIrisStudio studio;
|
||||
|
||||
@Command
|
||||
private CommandIrisWhat what;
|
||||
|
||||
@Command
|
||||
private CommandIrisObject object;
|
||||
|
||||
@Command
|
||||
private CommandIrisStructure structure;
|
||||
|
||||
@Command
|
||||
private CommandIrisCreate create;
|
||||
private CommandIrisObject object;
|
||||
|
||||
@Command
|
||||
private CommandIrisWhat what;
|
||||
|
||||
@Command
|
||||
private CommandIrisMetrics metrics;
|
||||
|
||||
@Command
|
||||
private CommandIrisCTC ctc;
|
||||
|
||||
@Command
|
||||
private CommandIrisLMM lmm;
|
||||
|
||||
@Command
|
||||
private CommandIrisPregen pregen;
|
||||
|
||||
public CommandIris()
|
||||
{
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.Command;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -48,6 +49,12 @@ public class CommandIrisObject extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage("Iris Object Commands");
|
||||
printHelp(sender);
|
||||
return true;
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.Direction;
|
||||
@ -24,6 +25,12 @@ public class CommandIrisObjectContract extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.Direction;
|
||||
@ -24,6 +25,12 @@ public class CommandIrisObjectExpand extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -26,6 +27,12 @@ public class CommandIrisObjectP1 extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -26,6 +27,12 @@ public class CommandIrisObjectP2 extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.object.IrisObject;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
@ -28,6 +29,12 @@ public class CommandIrisObjectPaste extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.object.IrisObject;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
@ -25,6 +26,12 @@ public class CommandIrisObjectSave extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.Direction;
|
||||
@ -24,6 +25,12 @@ public class CommandIrisObjectShift extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.Sound;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -20,6 +21,12 @@ public class CommandIrisObjectWand extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have an inventory");
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
@ -26,6 +27,12 @@ public class CommandIrisObjectXAY extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
@ -26,6 +27,12 @@ public class CommandIrisObjectXPY extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Objects, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -1,55 +0,0 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.gen.IrisChunkGenerator;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisRetry extends MortarCommand {
|
||||
public CommandIrisRetry() {
|
||||
super("retry", "again", "rt");
|
||||
setDescription("Retry generating in a failed state");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args) {
|
||||
if (sender.isPlayer()) {
|
||||
Player p = sender.player();
|
||||
World world = p.getWorld();
|
||||
|
||||
if (!(world.getGenerator() instanceof IrisChunkGenerator)) {
|
||||
sender.sendMessage("You must be in an iris world.");
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisChunkGenerator g = (IrisChunkGenerator) world.getGenerator();
|
||||
|
||||
if (g.isFailing()) {
|
||||
sender.sendMessage("Retrying. If the server is unresponsive, you may need to restart the server.");
|
||||
g.retry();
|
||||
}
|
||||
|
||||
else {
|
||||
sender.sendMessage("This generator is not failing.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
else {
|
||||
sender.sendMessage("Players only.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage() {
|
||||
return "";
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.Command;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -39,6 +40,12 @@ public class CommandIrisStructure extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage("Iris Structure Commands");
|
||||
printHelp(sender);
|
||||
return true;
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.StructureTemplate;
|
||||
@ -20,6 +21,12 @@ public class CommandIrisStructureClose extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.StructureTemplate;
|
||||
@ -20,6 +21,12 @@ public class CommandIrisStructureCreate extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.StructureTemplate;
|
||||
@ -20,6 +21,12 @@ public class CommandIrisStructureExpand extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.StructureTemplate;
|
||||
@ -20,6 +21,12 @@ public class CommandIrisStructureMore extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.object.IrisStructure;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -21,6 +22,12 @@ public class CommandIrisStructureOpen extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.StructureTemplate;
|
||||
@ -20,6 +21,12 @@ public class CommandIrisStructureSave extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@ -19,6 +20,12 @@ public class CommandIrisStructureVariants extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio Structures, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!sender.isPlayer())
|
||||
{
|
||||
sender.sendMessage("You don't have a wand");
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.Command;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -29,37 +30,22 @@ public class CommandIrisStudio extends MortarCommand
|
||||
private CommandIrisStudioUpdate update;
|
||||
|
||||
@Command
|
||||
private CommandIrisMap map;
|
||||
private CommandIrisStudioMap map;
|
||||
|
||||
@Command
|
||||
private CommandIrisStudioList list;
|
||||
|
||||
@Command
|
||||
private CommandIrisGoto got0;
|
||||
private CommandIrisStudioGoto got0;
|
||||
|
||||
@Command
|
||||
private CommandIrisEditBiome ebiome;
|
||||
private CommandIrisStudioEditBiome ebiome;
|
||||
|
||||
@Command
|
||||
private CommandIrisMetrics metrics;
|
||||
private CommandIrisStudioHotload hotload;
|
||||
|
||||
@Command
|
||||
private CommandIrisPregen pregen;
|
||||
|
||||
@Command
|
||||
private CommandIrisPregen world;
|
||||
|
||||
@Command
|
||||
private CommandIrisHotload hotload;
|
||||
|
||||
@Command
|
||||
private CommandIrisCTC ctc;
|
||||
|
||||
@Command
|
||||
private CommandIrisLMM lmm;
|
||||
|
||||
@Command
|
||||
private CommandIrisLoot loot;
|
||||
private CommandIrisStudioLoot loot;
|
||||
|
||||
public CommandIrisStudio()
|
||||
{
|
||||
@ -71,6 +57,12 @@ public class CommandIrisStudio extends MortarCommand
|
||||
@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;
|
||||
}
|
||||
|
||||
sender.sendMessage("Iris Studio Commands");
|
||||
printHelp(sender);
|
||||
return true;
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@ -21,6 +22,12 @@ public class CommandIrisStudioClose extends MortarCommand
|
||||
@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(!Iris.proj.isProjectOpen())
|
||||
{
|
||||
sender.sendMessage("No open projects.");
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -18,6 +19,12 @@ public class CommandIrisStudioCreate extends MortarCommand
|
||||
@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(args.length != 1)
|
||||
{
|
||||
sender.sendMessage("Please use a lowercase name with hyphens (-) for spaces.");
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
@ -19,6 +20,12 @@ public class CommandIrisStudioDownload extends MortarCommand
|
||||
@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(args.length < 1)
|
||||
{
|
||||
sender.sendMessage("/iris std dl " + C.BOLD + "<NAME>");
|
||||
|
@ -6,12 +6,13 @@ import java.io.File;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisEditBiome extends MortarCommand
|
||||
public class CommandIrisStudioEditBiome extends MortarCommand
|
||||
{
|
||||
public CommandIrisEditBiome()
|
||||
public CommandIrisStudioEditBiome()
|
||||
{
|
||||
super("editbiome", "ebiome", "eb");
|
||||
setDescription("Open this biome file in vscode");
|
||||
@ -22,6 +23,12 @@ public class CommandIrisEditBiome extends MortarCommand
|
||||
@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();
|
@ -5,15 +5,16 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.gen.IrisChunkGenerator;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.RNG;
|
||||
|
||||
public class CommandIrisGoto extends MortarCommand
|
||||
public class CommandIrisStudioGoto extends MortarCommand
|
||||
{
|
||||
public CommandIrisGoto()
|
||||
public CommandIrisStudioGoto()
|
||||
{
|
||||
super("goto", "find");
|
||||
setDescription("Find any biome or a biome border");
|
||||
@ -24,6 +25,12 @@ public class CommandIrisGoto extends MortarCommand
|
||||
@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(args.length < 1)
|
||||
{
|
||||
sender.sendMessage("/iris world goto " + getArgsUsage());
|
@ -4,12 +4,15 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.gen.IrisChunkGenerator;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisHotload extends MortarCommand {
|
||||
public CommandIrisHotload() {
|
||||
public class CommandIrisStudioHotload extends MortarCommand
|
||||
{
|
||||
public CommandIrisStudioHotload()
|
||||
{
|
||||
super("hotload", "hot", "h", "reload");
|
||||
setDescription("Force a hotload");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
@ -17,12 +20,21 @@ public class CommandIrisHotload extends MortarCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args) {
|
||||
if (sender.isPlayer()) {
|
||||
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 IrisChunkGenerator)) {
|
||||
if(!(world.getGenerator() instanceof IrisChunkGenerator))
|
||||
{
|
||||
sender.sendMessage("You must be in an iris world.");
|
||||
return true;
|
||||
}
|
||||
@ -33,7 +45,8 @@ public class CommandIrisHotload extends MortarCommand {
|
||||
return true;
|
||||
}
|
||||
|
||||
else {
|
||||
else
|
||||
{
|
||||
sender.sendMessage("Players only.");
|
||||
}
|
||||
|
||||
@ -41,7 +54,8 @@ public class CommandIrisHotload extends MortarCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage() {
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import java.io.File;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -20,6 +21,12 @@ public class CommandIrisStudioList extends MortarCommand
|
||||
@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;
|
||||
}
|
||||
|
||||
int m = 0;
|
||||
for(File i : Iris.globaldata.getDimensionLoader().getFolders())
|
||||
{
|
||||
|
@ -6,6 +6,7 @@ import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.object.InventorySlotType;
|
||||
import com.volmit.iris.object.IrisLootTable;
|
||||
import com.volmit.iris.util.KList;
|
||||
@ -14,9 +15,9 @@ import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.O;
|
||||
import com.volmit.iris.util.RNG;
|
||||
|
||||
public class CommandIrisLoot extends MortarCommand
|
||||
public class CommandIrisStudioLoot extends MortarCommand
|
||||
{
|
||||
public CommandIrisLoot()
|
||||
public CommandIrisStudioLoot()
|
||||
{
|
||||
super("loot");
|
||||
setDescription("Show loot if a chest were right here");
|
||||
@ -27,6 +28,12 @@ public class CommandIrisLoot extends MortarCommand
|
||||
@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();
|
@ -1,14 +1,15 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.gen.IrisChunkGenerator;
|
||||
import com.volmit.iris.gui.IrisVision;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisMap extends MortarCommand
|
||||
public class CommandIrisStudioMap extends MortarCommand
|
||||
{
|
||||
public CommandIrisMap()
|
||||
public CommandIrisStudioMap()
|
||||
{
|
||||
super("map", "render");
|
||||
setDescription("Render a map (gui outside of mc)");
|
||||
@ -19,6 +20,18 @@ public class CommandIrisMap extends MortarCommand
|
||||
@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(!IrisSettings.get().isUseServerLaunchedGuis())
|
||||
{
|
||||
sender.sendMessage("To use Iris Guis, please enable serverLaunchedGuis in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
IrisChunkGenerator g = Iris.proj.getCurrentProject();
|
||||
IrisVision.launch(g);
|
||||
sender.sendMessage("Opening Map!");
|
@ -1,6 +1,7 @@
|
||||
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;
|
||||
|
||||
@ -17,6 +18,12 @@ public class CommandIrisStudioOpen extends MortarCommand
|
||||
@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(args.length != 1)
|
||||
{
|
||||
sender.sendMessage("/iris std open <DIMENSION> (file name without .json)");
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
@ -18,6 +19,12 @@ public class CommandIrisStudioPackage extends MortarCommand
|
||||
@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(args.length == 0)
|
||||
{
|
||||
sender.sendMessage("/iris std package <DIMENSION> [-o]");
|
||||
|
@ -1,11 +1,14 @@
|
||||
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 CommandIrisStudioUpdate extends MortarCommand {
|
||||
public CommandIrisStudioUpdate() {
|
||||
public class CommandIrisStudioUpdate extends MortarCommand
|
||||
{
|
||||
public CommandIrisStudioUpdate()
|
||||
{
|
||||
super("update", "upd");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setDescription("Update your dimension project.");
|
||||
@ -13,8 +16,16 @@ public class CommandIrisStudioUpdate extends MortarCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args) {
|
||||
if (args.length == 0) {
|
||||
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(args.length == 0)
|
||||
{
|
||||
sender.sendMessage("/iris std package <DIMENSION>");
|
||||
return true;
|
||||
}
|
||||
@ -25,7 +36,8 @@ public class CommandIrisStudioUpdate extends MortarCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage() {
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
return "[dimension]";
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,15 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisStudioVerify extends MortarCommand {
|
||||
public CommandIrisStudioVerify() {
|
||||
public class CommandIrisStudioVerify extends MortarCommand
|
||||
{
|
||||
public CommandIrisStudioVerify()
|
||||
{
|
||||
super("verify", "check", "v");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
setDescription("Check project for warnings and issues");
|
||||
@ -14,8 +17,16 @@ public class CommandIrisStudioVerify extends MortarCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args) {
|
||||
if (args.length != 1) {
|
||||
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(args.length != 1)
|
||||
{
|
||||
sender.sendMessage("/iris std verify <DIMENSION> (file name without .json)");
|
||||
}
|
||||
|
||||
@ -25,12 +36,15 @@ public class CommandIrisStudioVerify extends MortarCommand {
|
||||
int e = 0;
|
||||
int w = 0;
|
||||
|
||||
for (String i : mm) {
|
||||
if (i.contains("ERROR")) {
|
||||
for(String i : mm)
|
||||
{
|
||||
if(i.contains("ERROR"))
|
||||
{
|
||||
e++;
|
||||
}
|
||||
|
||||
if (i.contains("WARN")) {
|
||||
if(i.contains("WARN"))
|
||||
{
|
||||
w++;
|
||||
}
|
||||
}
|
||||
@ -42,7 +56,8 @@ public class CommandIrisStudioVerify extends MortarCommand {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage() {
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
return "[dimension]";
|
||||
}
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ public class IrisChunkGenerator extends PostBlockChunkGenerator implements IrisC
|
||||
@Override
|
||||
public void onHotloaded()
|
||||
{
|
||||
if(!IrisSettings.get().hotloading)
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class ObjectResourceLoader extends ResourceLoader<IrisObject>
|
||||
IrisObject t = new IrisObject(0, 0, 0);
|
||||
t.read(j);
|
||||
loadCache.put(key, t);
|
||||
Iris.hotloader.track(j);
|
||||
J.a(() -> Iris.verbose("Loading " + resourceTypeName + ": " + j.getPath()));
|
||||
t.setLoadKey(name);
|
||||
lock.unlock();
|
||||
|
@ -83,7 +83,6 @@ public class ResourceLoader<T extends IrisRegistrant>
|
||||
{
|
||||
T t = new Gson().fromJson(IO.readAll(j), objectClass);
|
||||
loadCache.put(key, t);
|
||||
Iris.hotloader.track(j);
|
||||
J.a(() -> Iris.verbose("Loading " + resourceTypeName + ": " + j.getPath()));
|
||||
t.setLoadKey(name);
|
||||
t.setLoadFile(j);
|
||||
|
Loading…
x
Reference in New Issue
Block a user