mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-26 02:29:14 +00:00
Command stuffs
This commit is contained in:
@@ -15,7 +15,6 @@ import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import com.minelazz.epicworldgenerator.structures.StructureObject;
|
||||
import com.volmit.iris.command.CommandIris;
|
||||
import com.volmit.iris.command.PermissionIris;
|
||||
import com.volmit.iris.gen.IrisTerrainProvider;
|
||||
@@ -45,7 +44,7 @@ import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.M;
|
||||
import com.volmit.iris.util.MetricsLite;
|
||||
import com.volmit.iris.util.MortarPlugin;
|
||||
import com.volmit.iris.util.VolmitPlugin;
|
||||
import com.volmit.iris.util.NastyRunnable;
|
||||
import com.volmit.iris.util.Permission;
|
||||
import com.volmit.iris.util.Queue;
|
||||
@@ -54,7 +53,7 @@ import com.volmit.iris.util.ShurikenQueue;
|
||||
|
||||
import io.papermc.lib.PaperLib;
|
||||
|
||||
public class Iris extends MortarPlugin
|
||||
public class Iris extends VolmitPlugin
|
||||
{
|
||||
public static KList<GroupedExecutor> executors = new KList<>();
|
||||
public static Iris instance;
|
||||
|
||||
@@ -38,6 +38,10 @@ public class IrisSettings
|
||||
@Desc("More cpu for pregen gui but looks nice.")
|
||||
public boolean maxPregenGuiFPS = false;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Adds sound to commands.")
|
||||
public boolean commandSounds = true;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Compress parallax data in memory to reduce memory usage in exchange for more cpu usage.")
|
||||
public boolean parallaxCompression = true;
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.gen.v2.TestGen;
|
||||
import com.volmit.iris.util.Command;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -74,6 +75,11 @@ public class CommandIris extends MortarCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -19,6 +20,14 @@ public class CommandIrisCTC extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
if(args.length == 0)
|
||||
{
|
||||
list.qadd("4").qadd("8").qadd("12").qadd("16").qadd("18").qadd("24").qadd("32");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -45,6 +45,11 @@ public class CommandIrisCapture extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.volmit.iris.command;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
@@ -14,12 +15,6 @@ import com.volmit.iris.gen.provisions.ProvisionBukkit;
|
||||
import com.volmit.iris.gen.scaffold.IrisGenConfiguration;
|
||||
import com.volmit.iris.gen.scaffold.TerrainTarget;
|
||||
import com.volmit.iris.object.IrisDimension;
|
||||
import com.volmit.iris.util.Form;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.O;
|
||||
import com.volmit.iris.util.PregenJob;
|
||||
|
||||
public class CommandIrisCreate extends MortarCommand
|
||||
{
|
||||
@@ -31,6 +26,11 @@ public class CommandIrisCreate extends MortarCommand
|
||||
setDescription("Create a new Iris World!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.manager.ProjectManager;
|
||||
import com.volmit.iris.util.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class CommandIrisDownload extends MortarCommand
|
||||
{
|
||||
@@ -16,6 +16,11 @@ public class CommandIrisDownload extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -14,6 +15,11 @@ public class CommandIrisLMM extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -7,10 +8,6 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.gen.IrisTerrainProvider;
|
||||
import com.volmit.iris.gen.scaffold.IrisMetrics;
|
||||
import com.volmit.iris.gen.scaffold.IrisWorlds;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.Form;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisMetrics extends MortarCommand
|
||||
{
|
||||
@@ -22,6 +19,11 @@ public class CommandIrisMetrics extends MortarCommand
|
||||
setCategory("Metrics");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -46,6 +47,11 @@ public class CommandIrisObject extends MortarCommand
|
||||
setDescription("Object Commands");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -7,10 +8,6 @@ import org.bukkit.entity.Player;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.manager.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.Direction;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisObjectContract extends MortarCommand
|
||||
{
|
||||
@@ -22,6 +19,11 @@ public class CommandIrisObjectContract extends MortarCommand
|
||||
setDescription("Contract a selection based on your lookign direction");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -7,10 +8,6 @@ import org.bukkit.entity.Player;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.manager.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.Direction;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisObjectExpand extends MortarCommand
|
||||
{
|
||||
@@ -22,6 +19,11 @@ public class CommandIrisObjectExpand extends MortarCommand
|
||||
setDescription("Expand based on looking direction");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.volmit.iris.command;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -23,6 +24,11 @@ public class CommandIrisObjectP1 extends MortarCommand
|
||||
setDescription("Set point 1 to pos (or look)");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.volmit.iris.command;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -23,6 +24,11 @@ public class CommandIrisObjectP2 extends MortarCommand
|
||||
setDescription("Set point 1 to pos (or look)");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@@ -27,6 +28,11 @@ public class CommandIrisObjectPaste extends MortarCommand
|
||||
setDescription("Paste an object");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.volmit.iris.command;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -23,6 +24,11 @@ public class CommandIrisObjectSave extends MortarCommand
|
||||
setDescription("Save an object");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -7,10 +8,6 @@ import org.bukkit.entity.Player;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.manager.WandManager;
|
||||
import com.volmit.iris.util.Cuboid;
|
||||
import com.volmit.iris.util.Direction;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisObjectShift extends MortarCommand
|
||||
{
|
||||
@@ -22,6 +19,11 @@ public class CommandIrisObjectShift extends MortarCommand
|
||||
setDescription("Shift selection based on direction");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Sound;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -18,6 +19,11 @@ public class CommandIrisObjectWand extends MortarCommand
|
||||
setDescription("Get an Iris Wand for selecting objects");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@@ -24,6 +25,11 @@ public class CommandIrisObjectXAY extends MortarCommand
|
||||
setDescription("Auto select up, down and out");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
@@ -24,6 +25,11 @@ public class CommandIrisObjectXPY extends MortarCommand
|
||||
setDescription("Auto select up and out");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -18,6 +19,19 @@ public class CommandIrisPregen extends MortarCommand
|
||||
setCategory("Pregen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
list.add("stop");
|
||||
list.add("pause");
|
||||
list.add("resume");
|
||||
list.add("500");
|
||||
list.add("1000");
|
||||
list.add("10k");
|
||||
list.add("25k");
|
||||
list.add("chunksAcross=20");
|
||||
list.add("regionsAcross=8");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
@@ -69,7 +83,7 @@ public class CommandIrisPregen extends MortarCommand
|
||||
{
|
||||
Player p = sender.player();
|
||||
World world = p.getWorld();
|
||||
new PregenJob(world, Integer.valueOf(args[0]), sender, () ->
|
||||
new PregenJob(world, getVal(args[0]), sender, () ->
|
||||
{
|
||||
});
|
||||
|
||||
@@ -83,6 +97,28 @@ public class CommandIrisPregen extends MortarCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
private int getVal(String arg) {
|
||||
if(arg.toLowerCase().endsWith("k"))
|
||||
{
|
||||
return Integer.valueOf(arg.toLowerCase().replaceAll("\\Qk\\E", "")) * 1000;
|
||||
}
|
||||
|
||||
if(arg.toLowerCase().contains("chunksAcross="))
|
||||
{
|
||||
return Integer.valueOf(arg.toLowerCase().replaceAll("\\QchunksAcross=\\E", "")) * 16;
|
||||
}
|
||||
|
||||
if(arg.toLowerCase().endsWith("regionsAcross="))
|
||||
{
|
||||
return Integer.valueOf(arg.toLowerCase().replaceAll("\\QregionsAcross=\\E", "")) * 16;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return Integer.valueOf(arg.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -19,6 +20,13 @@ public class CommandIrisRegen extends MortarCommand
|
||||
setCategory("Regen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
list.add("3");
|
||||
list.add("7");
|
||||
list.add("9");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ 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;
|
||||
|
||||
@@ -15,6 +16,11 @@ public class CommandIrisReload extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -37,6 +38,11 @@ public class CommandIrisStructure extends MortarCommand
|
||||
setDescription("Structure Commands");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -18,6 +19,11 @@ public class CommandIrisStructureClose extends MortarCommand
|
||||
setDescription("Close a structure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -18,6 +19,11 @@ public class CommandIrisStructureCreate extends MortarCommand
|
||||
setDescription("Create a structure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args) {
|
||||
if (!IrisSettings.get().isStudio()) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -18,6 +19,11 @@ public class CommandIrisStructureExpand extends MortarCommand
|
||||
setDescription("Expand out more of the structure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -18,6 +19,11 @@ public class CommandIrisStructureMove extends MortarCommand
|
||||
setDescription("Load more of the structure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -19,6 +20,11 @@ public class CommandIrisStructureOpen extends MortarCommand
|
||||
setDescription("Open an existing structure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -18,6 +19,11 @@ public class CommandIrisStructureSave extends MortarCommand
|
||||
setDescription("Save a structure");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -17,6 +18,11 @@ public class CommandIrisStructureVariants extends MortarCommand
|
||||
setDescription("Change or add variants in tile looking at");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -60,6 +61,11 @@ public class CommandIrisStudio extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -19,6 +20,11 @@ public class CommandIrisStudioClose extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ 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;
|
||||
|
||||
@@ -15,6 +16,11 @@ public class CommandIrisStudioConvert extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -16,6 +17,11 @@ public class CommandIrisStudioCreate extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import java.awt.Desktop;
|
||||
import java.io.File;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -20,6 +21,11 @@ public class CommandIrisStudioEditBiome extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ 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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -20,6 +21,11 @@ public class CommandIrisStudioExplorer extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ 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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -17,6 +18,11 @@ public class CommandIrisStudioExplorerGenerator extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -22,6 +23,14 @@ public class CommandIrisStudioGoto extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
if(args.length == 0 && sender.isPlayer() && IrisWorlds.isIrisWorld(sender.player().getWorld()))
|
||||
{
|
||||
list.add(IrisWorlds.getProvider(sender.player().getWorld()).getData().getBiomeLoader().getPreferredKeys());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -20,6 +21,11 @@ public class CommandIrisStudioHotload extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -18,6 +19,11 @@ public class CommandIrisStudioList extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -27,6 +27,11 @@ public class CommandIrisStudioLoot extends MortarCommand
|
||||
setCategory("Loot");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.gen.IrisTerrainProvider;
|
||||
import com.volmit.iris.gui.IrisVision;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -17,6 +18,11 @@ public class CommandIrisStudioMap extends MortarCommand
|
||||
setCategory("World");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ 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;
|
||||
|
||||
@@ -15,6 +16,11 @@ public class CommandIrisStudioOpen extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,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.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -16,6 +17,11 @@ public class CommandIrisStudioPackage extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -21,6 +22,11 @@ public class CommandIrisStudioSummon extends MortarCommand
|
||||
setCategory("Summon");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ 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;
|
||||
|
||||
@@ -15,6 +16,11 @@ public class CommandIrisStudioTP extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.volmit.iris.command;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import com.volmit.iris.manager.IrisProject;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -16,6 +17,11 @@ public class CommandIrisStudioUpdate extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.*;
|
||||
|
||||
public class CommandIrisUpdateProject extends MortarCommand
|
||||
{
|
||||
@@ -16,6 +13,11 @@ public class CommandIrisUpdateProject extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -3,10 +3,7 @@ package com.volmit.iris.command;
|
||||
import java.io.File;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.J;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
import com.volmit.iris.util.*;
|
||||
|
||||
public class CommandIrisUpdateWorld extends MortarCommand
|
||||
{
|
||||
@@ -18,6 +15,11 @@ public class CommandIrisUpdateWorld extends MortarCommand
|
||||
setCategory("Studio");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.Command;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
@@ -25,6 +26,11 @@ public class CommandIrisWhat extends MortarCommand
|
||||
setDescription("Figure out what stuff is");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@@ -21,6 +22,11 @@ public class CommandIrisWhatBiome extends MortarCommand
|
||||
setDescription("What biome am I in");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.*;
|
||||
import org.bukkit.FluidCollisionMode;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.B;
|
||||
import com.volmit.iris.util.C;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisWhatBlock extends MortarCommand
|
||||
{
|
||||
@@ -21,6 +18,11 @@ public class CommandIrisWhatBlock extends MortarCommand
|
||||
setDescription("WAILA, WAWLA etc");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import com.volmit.iris.util.KList;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -20,18 +21,36 @@ public class CommandIrisWhatHand extends MortarCommand
|
||||
setDescription("What block am I holding");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTabOptions(MortarSender sender, String[] args, KList<String> list) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(sender.isPlayer())
|
||||
{
|
||||
Player p = sender.player();
|
||||
BlockData bd = p.getInventory().getItemInMainHand().getType().createBlockData();
|
||||
if(!bd.getMaterial().equals(Material.AIR)) {
|
||||
sender.sendMessage("Material: " + C.GREEN + bd.getMaterial().name());
|
||||
sender.sendMessage("Full: " + C.WHITE + bd.getAsString(true));
|
||||
} else {
|
||||
sender.sendMessage("Please hold a block");
|
||||
try
|
||||
{
|
||||
BlockData bd = p.getInventory().getItemInMainHand().getType().createBlockData();
|
||||
if(!bd.getMaterial().equals(Material.AIR)) {
|
||||
sender.sendMessage("Material: " + C.GREEN + bd.getMaterial().name());
|
||||
sender.sendMessage("Full: " + C.WHITE + bd.getAsString(true));
|
||||
} else {
|
||||
sender.sendMessage("Please hold a block/item");
|
||||
}
|
||||
}
|
||||
|
||||
catch(Throwable e)
|
||||
{
|
||||
Material bd = p.getInventory().getItemInMainHand().getType();
|
||||
if(!bd.equals(Material.AIR)) {
|
||||
sender.sendMessage("Material: " + C.GREEN + bd.name());
|
||||
} else {
|
||||
sender.sendMessage("Please hold a block/item");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,4 +50,6 @@ public interface ICommand
|
||||
* @return return true to mark it as handled
|
||||
*/
|
||||
public boolean handle(MortarSender sender, String[] args);
|
||||
|
||||
public KList<String> handleTab(MortarSender sender, String[] args);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import org.bukkit.Sound;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
@@ -37,6 +41,35 @@ public abstract class MortarCommand implements ICommand
|
||||
description = "No Description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public KList<String> handleTab(MortarSender sender, String[] args)
|
||||
{
|
||||
KList<String> v = new KList<>();
|
||||
if(args.length == 0)
|
||||
{
|
||||
for(MortarCommand i : getChildren())
|
||||
{
|
||||
v.add(i.getNode());
|
||||
}
|
||||
}
|
||||
|
||||
addTabOptions(sender, args, v);
|
||||
|
||||
if(v.isEmpty())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(sender.isPlayer() && IrisSettings.get().commandSounds)
|
||||
{
|
||||
sender.player().getWorld().playSound(sender.player().getLocation(), Sound.ENTITY_ITEM_FRAME_ROTATE_ITEM, 0.25f, 1.7f);
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
public abstract void addTabOptions(MortarSender sender, String[] args, KList<String> list);
|
||||
|
||||
public void printHelp(MortarSender sender)
|
||||
{
|
||||
boolean b = false;
|
||||
@@ -60,6 +93,12 @@ public abstract class MortarCommand implements ICommand
|
||||
{
|
||||
sender.sendMessage("There are either no sub-commands or you do not have permission to use them.");
|
||||
}
|
||||
|
||||
if(sender.isPlayer() && IrisSettings.get().commandSounds)
|
||||
{
|
||||
sender.player().getWorld().playSound(sender.player().getLocation(), Sound.ITEM_BOOK_PAGE_TURN, 0.28f, 1.4f);
|
||||
sender.player().getWorld().playSound(sender.player().getLocation(), Sound.ITEM_AXE_STRIP, 0.35f, 1.7f);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract String getArgsUsage();
|
||||
|
||||
@@ -2,7 +2,9 @@ package com.volmit.iris.util;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import com.volmit.iris.IrisSettings;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
@@ -78,7 +80,9 @@ public class VirtualCommand
|
||||
vs.setTag(tag);
|
||||
|
||||
if(label != null)
|
||||
{
|
||||
vs.setCommand(label);
|
||||
}
|
||||
|
||||
if(chain.isEmpty())
|
||||
{
|
||||
@@ -104,6 +108,11 @@ public class VirtualCommand
|
||||
c.remove(0);
|
||||
if(cmd.hit(sender, c, vs.getCommand()))
|
||||
{
|
||||
if(vs.isPlayer() && IrisSettings.get().commandSounds)
|
||||
{
|
||||
vs.player().getWorld().playSound(vs.player().getLocation(), Sound.ITEM_AXE_STRIP, 0.35f, 1.8f);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -118,6 +127,53 @@ public class VirtualCommand
|
||||
return command.handle(vs, chain.toArray(new String[chain.size()]));
|
||||
}
|
||||
|
||||
public KList<String> hitTab(CommandSender sender, KList<String> chain, String label)
|
||||
{
|
||||
MortarSender vs = new MortarSender(sender);
|
||||
vs.setTag(tag);
|
||||
|
||||
if(label != null)
|
||||
vs.setCommand(label);
|
||||
|
||||
if(chain.isEmpty())
|
||||
{
|
||||
if(!checkPermissions(sender, command))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return command.handleTab(vs, new String[0]);
|
||||
}
|
||||
|
||||
String nl = chain.get(0);
|
||||
|
||||
for(KList<String> i : children.k())
|
||||
{
|
||||
for(String j : i)
|
||||
{
|
||||
if(j.equalsIgnoreCase(nl))
|
||||
{
|
||||
vs.setCommand(chain.get(0));
|
||||
VirtualCommand cmd = children.get(i);
|
||||
KList<String> c = chain.copy();
|
||||
c.remove(0);
|
||||
KList<String> v = cmd.hitTab(sender, c, vs.getCommand());
|
||||
if(v != null)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!checkPermissions(sender, command))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return command.handleTab(vs, chain.toArray(new String[chain.size()]));
|
||||
}
|
||||
|
||||
private boolean checkPermissions(CommandSender sender, ICommand command2)
|
||||
{
|
||||
boolean failed = false;
|
||||
|
||||
@@ -6,9 +6,11 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -16,14 +18,17 @@ import org.bukkit.command.PluginCommand;
|
||||
import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.permissions.PermissionDefault;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public abstract class MortarPlugin extends JavaPlugin implements Listener
|
||||
public abstract class VolmitPlugin extends JavaPlugin implements Listener
|
||||
{
|
||||
public static boolean bad = false;
|
||||
private KMap<KList<String>, VirtualCommand> commands;
|
||||
@@ -471,6 +476,42 @@ public abstract class MortarPlugin extends JavaPlugin implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command,
|
||||
@NotNull String alias, @NotNull String[] args) {
|
||||
KList<String> chain = new KList<String>();
|
||||
|
||||
for(String i : args)
|
||||
{
|
||||
if(i.trim().isEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
chain.add(i.trim());
|
||||
}
|
||||
|
||||
for(KList<String> i : commands.k())
|
||||
{
|
||||
for(String j : i)
|
||||
{
|
||||
if(j.equalsIgnoreCase(alias))
|
||||
{
|
||||
VirtualCommand cmd = commands.get(i);
|
||||
|
||||
List<String> v = cmd.hitTab(sender, chain.copy(), alias);
|
||||
if(v != null)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return super.onTabComplete(sender, command, alias, args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, org.bukkit.command.Command command, String label, String[] args)
|
||||
{
|
||||
Reference in New Issue
Block a user