mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-30 04:29:05 +00:00
FIxes
This commit is contained in:
@@ -3,11 +3,15 @@ package com.volmit.iris.command;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.gui.NoiseExplorer;
|
||||
import com.volmit.iris.util.Command;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisStudioExplorer extends MortarCommand
|
||||
{
|
||||
@Command
|
||||
private CommandIrisStudioExplorerGenerator generator;
|
||||
|
||||
public CommandIrisStudioExplorer()
|
||||
{
|
||||
super("noise", "nmap");
|
||||
@@ -19,20 +23,28 @@ public class CommandIrisStudioExplorer extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(!IrisSettings.get().isStudio())
|
||||
if(args.length != 0)
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
printHelp(sender);
|
||||
}
|
||||
|
||||
if(!IrisSettings.get().isUseServerLaunchedGuis())
|
||||
else
|
||||
{
|
||||
sender.sendMessage("To use Iris Guis, please enable serverLaunchedGuis in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
if(!IrisSettings.get().isStudio())
|
||||
{
|
||||
sender.sendMessage("To use Iris Studio, please enable studio in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
NoiseExplorer.launch();
|
||||
sender.sendMessage("Opening Noise Explorer!");
|
||||
if(!IrisSettings.get().isUseServerLaunchedGuis())
|
||||
{
|
||||
sender.sendMessage("To use Iris Guis, please enable serverLaunchedGuis in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
NoiseExplorer.launch();
|
||||
sender.sendMessage("Opening Noise Explorer!");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.gui.NoiseExplorer;
|
||||
import com.volmit.iris.object.IrisGenerator;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisStudioExplorerGenerator extends MortarCommand
|
||||
{
|
||||
public CommandIrisStudioExplorerGenerator()
|
||||
{
|
||||
super("generator", "gen", "g");
|
||||
setDescription("Explore different generators");
|
||||
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(!IrisSettings.get().isUseServerLaunchedGuis())
|
||||
{
|
||||
sender.sendMessage("To use Iris Guis, please enable serverLaunchedGuis in Iris/settings.json");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(Iris.proj.getCurrentProject() == null)
|
||||
{
|
||||
sender.sendMessage("No project is open");
|
||||
return true;
|
||||
}
|
||||
|
||||
if(args.length == 0)
|
||||
{
|
||||
sender.sendMessage("Provide a generator name");
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
String g = args[0];
|
||||
IrisGenerator b = Iris.proj.getCurrentProject().getData().getGeneratorLoader().load(g);
|
||||
|
||||
if(b != null)
|
||||
{
|
||||
NoiseExplorer.launch((x, z) ->
|
||||
{
|
||||
return b.getHeight(x, z, Iris.proj.getCurrentProject().getMasterRandom().nextParallelRNG(3245).lmax());
|
||||
}, "Gen: " + b.getLoadKey());
|
||||
|
||||
sender.sendMessage("Opening Noise Explorer for gen " + b.getLoadKey());
|
||||
return true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
sender.sendMessage("Invalid Generator");
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user