SHOW:
|
|
- or go back to the newest paste.
| 1 | package com.outlook.devleeo.LsFight.utils; | |
| 2 | ||
| 3 | import com.outlook.devleeo.LsFight.LsFight; | |
| 4 | import com.outlook.devleeo.LsFight.outros.Files; | |
| 5 | import java.util.Calendar; | |
| 6 | import java.util.logging.Logger; | |
| 7 | import org.bukkit.Bukkit; | |
| 8 | import org.bukkit.command.ConsoleCommandSender; | |
| 9 | import org.bukkit.configuration.file.FileConfiguration; | |
| 10 | import org.bukkit.scheduler.BukkitScheduler; | |
| 11 | ||
| 12 | public class AutoStart | |
| 13 | {
| |
| 14 | private static boolean in = false; | |
| 15 | private static FileConfiguration data = Files.getInstance().getDataFile(); | |
| 16 | ||
| 17 | - | private static int getHora(String hora) |
| 17 | + | private static int getHora(String hora) {
|
| 18 | return Integer.parseInt(hora); | |
| 19 | - | String str = hora; |
| 19 | + | |
| 20 | - | switch (hora.hashCode()) |
| 20 | + | |
| 21 | private static int getMinuto(String minuto) {
| |
| 22 | - | case 1536: |
| 22 | + | |
| 23 | - | if (str.equals("00")) {
|
| 23 | + | |
| 24 | - | break; |
| 24 | + | |
| 25 | private static int getDia(String dia) | |
| 26 | {
| |
| 27 | - | case 1537: |
| 27 | + | |
| 28 | - | if (str.equals("01")) {}
|
| 28 | + | |
| 29 | {
| |
| 30 | - | case 1538: |
| 30 | + | |
| 31 | - | if (str.equals("02")) {}
|
| 31 | + | |
| 32 | return 0; | |
| 33 | - | case 1539: |
| 33 | + | |
| 34 | - | if (str.equals("03")) {}
|
| 34 | + | |
| 35 | case -948583818: | |
| 36 | - | case 1540: |
| 36 | + | |
| 37 | - | if (str.equals("04")) {}
|
| 37 | + | |
| 38 | } | |
| 39 | - | case 1541: |
| 39 | + | |
| 40 | - | if (str.equals("05")) {}
|
| 40 | + | |
| 41 | if (!lowerCase.equals("sabado")) {
| |
| 42 | - | case 1542: |
| 42 | + | |
| 43 | - | if (str.equals("06")) {}
|
| 43 | + | |
| 44 | return 7; | |
| 45 | - | case 1543: |
| 45 | + | |
| 46 | - | if (str.equals("07")) {}
|
| 46 | + | |
| 47 | return 0; | |
| 48 | - | case 1544: |
| 48 | + | |
| 49 | - | if (str.equals("08")) {}
|
| 49 | + | |
| 50 | case 110250047: | |
| 51 | - | case 1545: |
| 51 | + | |
| 52 | - | if (!str.equals("09"))
|
| 52 | + | |
| 53 | } | |
| 54 | - | break label276; |
| 54 | + | |
| 55 | - | hora = "0"; |
| 55 | + | |
| 56 | - | break label276; |
| 56 | + | |
| 57 | - | hora = "1"; |
| 57 | + | |
| 58 | - | break label276; |
| 58 | + | |
| 59 | - | hora = "2"; |
| 59 | + | |
| 60 | - | break label276; |
| 60 | + | |
| 61 | - | hora = "3"; |
| 61 | + | |
| 62 | - | break label276; |
| 62 | + | |
| 63 | - | hora = "4"; |
| 63 | + | |
| 64 | - | break label276; |
| 64 | + | |
| 65 | - | hora = "5"; |
| 65 | + | |
| 66 | - | break label276; |
| 66 | + | |
| 67 | - | hora = "6"; |
| 67 | + | |
| 68 | - | break label276; |
| 68 | + | |
| 69 | - | hora = "7"; |
| 69 | + | |
| 70 | - | break label276; |
| 70 | + | |
| 71 | - | hora = "8"; |
| 71 | + | |
| 72 | } | |
| 73 | - | else |
| 73 | + | |
| 74 | public static void checkTempo() | |
| 75 | - | hora = "9"; |
| 75 | + | |
| 76 | try | |
| 77 | {
| |
| 78 | for (String s : LsFight.getInstance().getConfig().getStringList("AutoStart.Horarios"))
| |
| 79 | - | label276: |
| 79 | + | |
| 80 | String[] a = s.split("-");
| |
| 81 | String[] horario1 = null; | |
| 82 | String dia1; | |
| 83 | - | private static int getMinuto(String minuto) |
| 83 | + | |
| 84 | {
| |
| 85 | - | String str = minuto; |
| 85 | + | |
| 86 | - | switch (minuto.hashCode()) |
| 86 | + | |
| 87 | } | |
| 88 | - | case 1536: |
| 88 | + | |
| 89 | - | if (str.equals("00")) {
|
| 89 | + | |
| 90 | - | break; |
| 90 | + | |
| 91 | horario1 = s.split("-")[0].split(":");
| |
| 92 | } | |
| 93 | - | case 1537: |
| 93 | + | |
| 94 | - | if (str.equals("01")) {}
|
| 94 | + | |
| 95 | Bukkit.getScheduler().scheduleSyncRepeatingTask(LsFight.getInstance(), new Runnable() | |
| 96 | - | case 1538: |
| 96 | + | |
| 97 | - | if (str.equals("02")) {}
|
| 97 | + | |
| 98 | {
| |
| 99 | - | case 1539: |
| 99 | + | |
| 100 | - | if (str.equals("03")) {}
|
| 100 | + | |
| 101 | if ((AutoStart.data.getString("Entrada.") == null) || (AutoStart.data.getString("Saida.") == null) || (AutoStart.data.getString("Pos1.") == null) || (AutoStart.data.getString("Pos2.") == null))
| |
| 102 | - | case 1540: |
| 102 | + | |
| 103 | - | if (str.equals("04")) {}
|
| 103 | + | |
| 104 | Bukkit.getLogger().severe("[LsFight] Nao foi possivel iniciar o evento, entrada, saida, posicao 1 ou posicao 2 nao foi definida.");
| |
| 105 | - | case 1541: |
| 105 | + | |
| 106 | - | if (str.equals("05")) {}
|
| 106 | + | |
| 107 | } | |
| 108 | - | case 1542: |
| 108 | + | |
| 109 | - | if (str.equals("06")) {}
|
| 109 | + | |
| 110 | FightUtils.iniciando(LsFight.getInstance().getConfig().getInt("Iniciando.NumeroDeAvisos"));
| |
| 111 | - | case 1543: |
| 111 | + | |
| 112 | - | if (str.equals("07")) {}
|
| 112 | + | |
| 113 | } | |
| 114 | - | case 1544: |
| 114 | + | |
| 115 | - | if (str.equals("08")) {}
|
| 115 | + | |
| 116 | if ((AutoStart.data.getString("Entrada.") == null) || (AutoStart.data.getString("Saida.") == null) || (AutoStart.data.getString("Pos1.") == null) || (AutoStart.data.getString("Pos2.") == null))
| |
| 117 | - | case 1545: |
| 117 | + | |
| 118 | - | if (!str.equals("09"))
|
| 118 | + | |
| 119 | Bukkit.getLogger().severe("[LsFight] Nao foi possivel iniciar o evento, entrada, saida, posicao 1 ou posicao 2 nao foi definida.");
| |
| 120 | - | break label276; |
| 120 | + | |
| 121 | - | minuto = "0"; |
| 121 | + | |
| 122 | - | break label276; |
| 122 | + | |
| 123 | - | minuto = "1"; |
| 123 | + | |
| 124 | - | break label276; |
| 124 | + | |
| 125 | - | minuto = "2"; |
| 125 | + | |
| 126 | - | break label276; |
| 126 | + | |
| 127 | - | minuto = "3"; |
| 127 | + | |
| 128 | - | break label276; |
| 128 | + | |
| 129 | - | minuto = "4"; |
| 129 | + | |
| 130 | - | break label276; |
| 130 | + | |
| 131 | - | minuto = "5"; |
| 131 | + | |
| 132 | - | break label276; |
| 132 | + | |
| 133 | - | minuto = "6"; |
| 133 | + | |
| 134 | - | break label276; |
| 134 | + | |
| 135 | - | minuto = "7"; |
| 135 | + | |
| 136 | - | break label276; |
| 136 | + | |
| 137 | - | minuto = "8"; |
| 137 | + | |
| 138 | } |