mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Merge pull request #90 from AtlasMediaGroup/FS-309
2 bugfixes, one command (FS-309)
This commit is contained in:
commit
0caf972248
@ -77,13 +77,26 @@ public class Command_cage extends FreedomCommand
|
|||||||
}
|
}
|
||||||
case "block":
|
case "block":
|
||||||
{
|
{
|
||||||
if (Material.matchMaterial(args[2]) != null)
|
if (args.length >= 3)
|
||||||
{
|
{
|
||||||
outerMaterial = Material.matchMaterial(args[2]);
|
// Checks the validity of the Material and checks if it's a block.
|
||||||
break;
|
// This is incredibly inefficient, as Spigot's isBlock() method in Material is an actual
|
||||||
|
// nightmare of switch-cases.
|
||||||
|
if (Material.matchMaterial(args[2]) != null && Material.matchMaterial(args[2]).isBlock())
|
||||||
|
{
|
||||||
|
outerMaterial = Material.matchMaterial(args[2]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
msg("Invalid block!", ChatColor.RED);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
msg("Invalid block!", ChatColor.RED);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user