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() public CommandIrisCTC()
{ {
super("ctc"); super("ctc", "threads", "thread");
setDescription("Change generator thread count"); setDescription("Change generator thread count");
requiresPermission(Iris.perm.studio); requiresPermission(Iris.perm.studio);
setCategory("World"); setCategory("World");

View File

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

View File

@ -15,11 +15,11 @@ public class CommandIrisWhatBlock extends MortarCommand
{ {
public CommandIrisWhatBlock() public CommandIrisWhatBlock()
{ {
super("block", "b"); super("block", "l", "bl");
setDescription("Get the block data for looking."); setDescription("Get the block data for looking.");
requiresPermission(Iris.perm.studio); requiresPermission(Iris.perm.studio);
setCategory("Wut"); setCategory("Wut");
setDescription("WAILA,WAWLA etc"); setDescription("WAILA, WAWLA etc");
} }
@Override @Override
@ -27,8 +27,18 @@ public class CommandIrisWhatBlock extends MortarCommand
{ {
if(sender.isPlayer()) if(sender.isPlayer())
{ {
BlockData bd;
Player p = sender.player(); 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) if(bd != null)
{ {
sender.sendMessage("Material: " + C.GREEN + bd.getMaterial().name()); sender.sendMessage("Material: " + C.GREEN + bd.getMaterial().name());
@ -68,6 +78,8 @@ public class CommandIrisWhatBlock extends MortarCommand
{ {
sender.sendMessage(C.YELLOW + "* Solid Block"); 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."); setDescription("Get the block data for holding.");
requiresPermission(Iris.perm.studio); requiresPermission(Iris.perm.studio);
setCategory("Wut"); setCategory("Wut");
setDescription("What block holding"); setDescription("What block am I holding");
} }
@Override @Override
@ -30,6 +30,8 @@ public class CommandIrisWhatHand extends MortarCommand
if(!bd.getMaterial().equals(Material.AIR)) { if(!bd.getMaterial().equals(Material.AIR)) {
sender.sendMessage("Material: " + C.GREEN + bd.getMaterial().name()); sender.sendMessage("Material: " + C.GREEN + bd.getMaterial().name());
sender.sendMessage("Full: " + C.WHITE + bd.getAsString(true)); sender.sendMessage("Full: " + C.WHITE + bd.getAsString(true));
} else {
sender.sendMessage("Please hold a block");
} }
} }