Fix bugs (see desc)

#33
#26
#27
#28
This commit is contained in:
BuildTools 2020-10-23 09:55:48 +02:00
parent 06ffe5cd06
commit 7fdbebfb70
4 changed files with 21 additions and 7 deletions

View File

@ -13,7 +13,7 @@ public class CommandIrisCTC extends MortarCommand
{
public CommandIrisCTC()
{
super("ctc");
super("ctc", "threads", "thread");
setDescription("Change generator thread count");
requiresPermission(Iris.perm.studio);
setCategory("World");

View File

@ -14,11 +14,11 @@ public class CommandIrisWhatBiome extends MortarCommand
{
public CommandIrisWhatBiome()
{
super("biome", "bi");
super("biome", "bi", "b");
setDescription("Get the biome data you are in.");
requiresPermission(Iris.perm.studio);
setCategory("Wut");
setDescription("What biome am i In");
setDescription("What biome am I in");
}
@Override

View File

@ -15,7 +15,7 @@ public class CommandIrisWhatBlock extends MortarCommand
{
public CommandIrisWhatBlock()
{
super("block", "b");
super("block", "l", "bl");
setDescription("Get the block data for looking.");
requiresPermission(Iris.perm.studio);
setCategory("Wut");
@ -27,8 +27,18 @@ public class CommandIrisWhatBlock extends MortarCommand
{
if(sender.isPlayer())
{
BlockData bd;
Player p = sender.player();
BlockData bd = p.getTargetBlockExact(128, FluidCollisionMode.NEVER).getBlockData();
try
{
bd = p.getTargetBlockExact(128, FluidCollisionMode.NEVER).getBlockData();
}
catch (NullPointerException e)
{
sender.sendMessage("Please look at any block, not at the sky");
bd = null;
}
if(bd != null)
{
sender.sendMessage("Material: " + C.GREEN + bd.getMaterial().name());
@ -68,6 +78,8 @@ public class CommandIrisWhatBlock extends MortarCommand
{
sender.sendMessage(C.YELLOW + "* Solid Block");
}
} else {
sender.sendMessage("Please look at any block, not at the sky");
}
}

View File

@ -17,7 +17,7 @@ public class CommandIrisWhatHand extends MortarCommand
setDescription("Get the block data for holding.");
requiresPermission(Iris.perm.studio);
setCategory("Wut");
setDescription("What block holding");
setDescription("What block am I holding");
}
@Override
@ -30,6 +30,8 @@ public class CommandIrisWhatHand extends MortarCommand
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");
}
}