Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (args[0].equals("force", true)) {
- if (sender.hasPermission("koth.force")) {
- println("s1")
- if (!this.instance.isEvent) {
- println("s2")
- val node: ConfigurationSection = instance.config.getConfigurationSection("locations")
- var x: Int = 0
- var y: Int = 0
- var z: Int = 0
- val timeList: List<String> = instance.config.getStringList("launchTime")
- if (timeList.isNotEmpty()) {
- println("s3")
- val hour: SimpleDateFormat = SimpleDateFormat("HH:mm")
- val date: Date = Date()
- timeList.forEach {
- println("s4")
- val split = it.split("#")
- if (node.getConfigurationSection(split[0].toLowerCase()) == null) {
- println("s02020")
- x = node.getInt("default.x")
- y = node.getInt("default.y")
- z = node.getInt("default.z")
- } else {
- if (split[0].toLowerCase() == LocalDate.now().dayOfWeek.toString().toLowerCase()) {
- println("s5")
- val random: ThreadLocalRandom = ThreadLocalRandom.current()
- val day: ConfigurationSection = node.getConfigurationSection(split[0].toLowerCase())
- val max: Int = day.getInt("cordAmount")
- val randCords = random.nextInt(0, max)+1
- x = day.getInt("$randCords.x")
- y = day.getInt("$randCords.y")
- z = day.getInt("$randCords.z")
- }
- }
- }
- forcedMessage.forEach { fc -> sender.sendMessage(ChatColor.translateAlternateColorCodes('&', fc.replace("[", "").replace("]", ""))) }
- this.instance.isEvent = true
- forceMessage.forEach { fc -> Bukkit.broadcastMessage(StringUtils.replaceEach(ChatColor.translateAlternateColorCodes('&', fc.replace("[", "").replace("]", "")),
- arrayOf("%x%", "%y%", "%z%"), arrayOf(x.toString(), y.toString(), z.toString()))) }
- this.instance.cords = arrayOf(x, y, z)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement