@Override public boolean onCommand( CommandSender sender, Command command, String commandLabel, String[] args) { String commandName = command.getName().toLowerCase(); Player player = (Player) sender; if (commandName.startsWith("mimic") && sender instanceof Player) { if (usePerms && !permValid.checkPlayerPermissions(player, "voxelmimic.mimic")) { player.sendMessage(ChatColor.RED + "You are not permitted to use this command."); return true; } int radius; boolean sphere = false; try { if (canSphere && args.length > 1) { if (args[1].equalsIgnoreCase("sphere")) sphere = true; } try { radius = Integer.parseInt(args[0]); if (voxelGuest && !voxelGuestMimic && !((vGuests.get(player.getName()) == null)) || voxelGuest && voxelGuestMimic || !voxelGuest) { if (radius > RADIUS) { radius = RADIUS; player.sendMessage( ChatColor.RED + "Radius too large. Reset to maximum of " + RADIUS); } performMimic(player, radius, sphere); return true; } else { player.sendMessage(ChatColor.RED + "You are not permitted to use this command."); return true; } } catch (ArrayIndexOutOfBoundsException e) { if (voxelGuest && !voxelGuestMimic && !((vGuests.get(player.getName()) == null)) || (voxelGuest && voxelGuestMimic) || !voxelGuest) { performMimic(player, RADIUS, sphere); return true; } else { player.sendMessage(ChatColor.RED + "You are not permitted to use this command."); return true; } } } catch (Exception ex) { player.sendMessage( ChatColor.RED + "Invalid mimic parameters! /mimic OR /mimic [radius] OR /mimic [radius] <sphere>"); return true; } } return false; }
public static void main(String args[]) { try { // JFrame f = new JFrame(); // JButton b = new JButton("STOP"); // b.addActionListener(new ActionListener(){ // public void actionPerformed(ActionEvent ev){ // RunnerRepository.run = false; // RunnerRepository.session.disconnect(); // RunnerRepository.connection.disconnect(); // RunnerRepository.window.mainpanel.p1.ep.session.disconnect(); // RunnerRepository.window.mainpanel.p1.ep.connection.disconnect(); // RunnerRepository.window.mainpanel.p1.lp.session.disconnect(); // RunnerRepository.window.mainpanel.p1.lp.connection.disconnect(); // RunnerRepository.window.mainpanel.p4.getPlugins().session.disconnect(); // RunnerRepository.window.mainpanel.p4.getPlugins().ch.disconnect(); // RunnerRepository.window.mainpanel.p4.getGlobals().session.disconnect(); // RunnerRepository.window.mainpanel.p4.getGlobals().ch.disconnect(); // // RunnerRepository.window.mainpanel.p4.getTestConfig().tree.session.disconnect(); // // RunnerRepository.window.mainpanel.p4.getTestConfig().tree.connection.disconnect(); // // RunnerRepository.window.mainpanel.p4.getTestConfig().cfgedit.session.disconnect(); // // RunnerRepository.window.mainpanel.p4.getTestConfig().cfgedit.ch.disconnect(); // } // }); // f.add(b); // f.setVisible(true); URL url = new URL("http://tsc-server/twister_gui/logo.png"); RunnerRepository.logo = ImageIO.read(url).getScaledInstance(230, 100, Image.SCALE_FAST); } catch (Exception e) { e.printStackTrace(); } readLogoTxt(); PermissionValidator.init( "CREATE_PROJECT,CHANGE_PROJECT,DELETE_PROJECT,CHANGE_PLUGINS," + "CHANGE_FWM_CFG,CHANGE_GLOBALS,RUN_TESTS,EDIT_TC," + "CHANGE_DB_CFG, CHANGE_EML_CFG,CHANGE_SERVICES,CHANGE_SUT"); // RunnerRepository.initialize("false","tsc-server",null); RunnerRepository.initialize("false", RunnerRepository.host, null); }