use of com.iridium.iridiumskyblock.gui.BlockValueGUI in project IridiumSkyblock by Iridium-Development.
the class BlockValueCommand method execute.
/**
* Executes the command for the specified {@link CommandSender} with the provided arguments.
* Not called when the command execution was invalid (no permission, no player or command disabled).
* Shows all the valuable blocks and spawners.
*
* @param sender The CommandSender which executes this command
* @param arguments The arguments used with this command. They contain the sub-command
*/
@Override
public boolean execute(CommandSender sender, String[] arguments) {
Player player = (Player) sender;
if (arguments.length != 2) {
player.openInventory(new InventoryConfigGUI(IridiumSkyblock.getInstance().getInventories().blockValueSelectGUI, player.getOpenInventory().getTopInventory()).getInventory());
return true;
}
BlockValueGUI.BlockValueType blockValueType = BlockValueGUI.BlockValueType.getType(arguments[1]);
if (blockValueType == null) {
player.openInventory(new InventoryConfigGUI(IridiumSkyblock.getInstance().getInventories().blockValueSelectGUI, player.getOpenInventory().getTopInventory()).getInventory());
return true;
}
player.openInventory(new BlockValueGUI(blockValueType, player.getOpenInventory().getTopInventory()).getInventory());
return true;
}
Aggregations