9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-30 04:29:05 +00:00
This commit is contained in:
Daniel Mills
2020-08-24 12:35:57 -04:00
parent 273f7c7a73
commit 998e1b62a5
8 changed files with 354 additions and 27 deletions

View File

@@ -10,6 +10,9 @@ public class CommandIrisStructure extends MortarCommand
@Command
private CommandIrisStructureCreate create;
@Command
private CommandIrisStructureOpen open;
@Command
private CommandIrisStructureSave save;
@@ -19,6 +22,9 @@ public class CommandIrisStructure extends MortarCommand
@Command
private CommandIrisStructureExpand expand;
@Command
private CommandIrisStructureVariants variants;
@Command
private CommandIrisStructureClose close;

View File

@@ -0,0 +1,51 @@
package com.volmit.iris.command;
import org.bukkit.entity.Player;
import com.volmit.iris.Iris;
import com.volmit.iris.object.IrisStructure;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
import com.volmit.iris.util.StructureTemplate;
public class CommandIrisStructureOpen extends MortarCommand
{
public CommandIrisStructureOpen()
{
super("load", "open", "o");
requiresPermission(Iris.perm);
setCategory("Structure");
setDescription("Open an existing structure");
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!sender.isPlayer())
{
sender.sendMessage("You don't have a wand");
return true;
}
Player p = sender.player();
IrisStructure structure = Iris.globaldata.getStructureLoader().load(args[0]);
if(structure == null)
{
sender.sendMessage("Can't find " + args[0]);
return true;
}
String dimensionGuess = structure.getLoadFile().getParentFile().getParentFile().getName();
new StructureTemplate(structure.getName(), dimensionGuess, p, p.getLocation(), 9, structure.getGridSize(), structure.getGridHeight(), structure.getMaxLayers() > 1).loadStructures(structure);
return true;
}
@Override
protected String getArgsUsage()
{
return "<structure>";
}
}

View File

@@ -0,0 +1,40 @@
package com.volmit.iris.command;
import org.bukkit.entity.Player;
import com.volmit.iris.Iris;
import com.volmit.iris.util.MortarCommand;
import com.volmit.iris.util.MortarSender;
public class CommandIrisStructureVariants extends MortarCommand
{
public CommandIrisStructureVariants()
{
super("variants", "var", "v");
requiresPermission(Iris.perm);
setCategory("Structure");
setDescription("Change or add variants in tile looking at");
}
@Override
public boolean handle(MortarSender sender, String[] args)
{
if(!sender.isPlayer())
{
sender.sendMessage("You don't have a wand");
return true;
}
Player p = sender.player();
Iris.struct.get(p).openVariants();
return true;
}
@Override
protected String getArgsUsage()
{
return "";
}
}