|
| 1 | +package kr.toxicity.hud.api; |
| 2 | + |
| 3 | +import lombok.Getter; |
| 4 | +import org.jetbrains.annotations.NotNull; |
| 5 | +import org.jetbrains.annotations.Unmodifiable; |
| 6 | + |
| 7 | +import java.util.ArrayList; |
| 8 | +import java.util.Collections; |
| 9 | +import java.util.List; |
| 10 | + |
| 11 | +@Getter |
| 12 | +@SuppressWarnings("unused") |
| 13 | +public class BetterHudDependency { |
| 14 | + private static final List<BetterHudDependency> DEPENDENCIES = new ArrayList<>(); |
| 15 | + |
| 16 | + private final @NotNull String group; |
| 17 | + private final @NotNull String name; |
| 18 | + private final @NotNull String version; |
| 19 | + private final boolean relocate; |
| 20 | + private final @NotNull @Unmodifiable List<BetterHudPlatform> platforms; |
| 21 | + |
| 22 | + private BetterHudDependency( |
| 23 | + @NotNull String group, |
| 24 | + @NotNull String name, |
| 25 | + @NotNull String version, |
| 26 | + boolean relocate, |
| 27 | + @NotNull @Unmodifiable List<BetterHudPlatform> platforms |
| 28 | + ) { |
| 29 | + this.group = group; |
| 30 | + this.name = name; |
| 31 | + this.version = version; |
| 32 | + this.relocate = relocate; |
| 33 | + this.platforms = platforms; |
| 34 | + |
| 35 | + DEPENDENCIES.add(this); |
| 36 | + } |
| 37 | + |
| 38 | + public static @NotNull @Unmodifiable List<BetterHudDependency> dependencies() { |
| 39 | + return Collections.unmodifiableList(DEPENDENCIES); |
| 40 | + } |
| 41 | + |
| 42 | + public static final BetterHudDependency GSON = new BetterHudDependency( |
| 43 | + "com{}google{}code{}gson", |
| 44 | + "gson", |
| 45 | + "2.11.0", |
| 46 | + false, |
| 47 | + List.of(BetterHudPlatform.VELOCITY) |
| 48 | + ); |
| 49 | + public static final BetterHudDependency SNAKEYAML = new BetterHudDependency( |
| 50 | + "org{}yaml", |
| 51 | + "snakeyaml", |
| 52 | + "2.3", |
| 53 | + false, |
| 54 | + List.of(BetterHudPlatform.VELOCITY, BetterHudPlatform.FABRIC) |
| 55 | + ); |
| 56 | + public static final BetterHudDependency MYSQL_CONNECTOR_J = new BetterHudDependency( |
| 57 | + "com{}mysql", |
| 58 | + "mysql-connector-j", |
| 59 | + "9.1.0", |
| 60 | + false, |
| 61 | + List.of(BetterHudPlatform.VELOCITY, BetterHudPlatform.FABRIC) |
| 62 | + ); |
| 63 | + public static final BetterHudDependency ASM_COMMONS = new BetterHudDependency( |
| 64 | + "org{}ow2{}asm", |
| 65 | + "asm-commons", |
| 66 | + "9.7.1", |
| 67 | + false, |
| 68 | + List.of(BetterHudPlatform.VELOCITY) |
| 69 | + ); |
| 70 | + public static final BetterHudDependency EXP4J = new BetterHudDependency( |
| 71 | + "net{}objecthunter", |
| 72 | + "exp4j", |
| 73 | + "0.4.8", |
| 74 | + true, |
| 75 | + BetterHudPlatform.ALL |
| 76 | + ); |
| 77 | + |
| 78 | + |
| 79 | + public static final BetterHudDependency ADVENTURE_API = new BetterHudDependency( |
| 80 | + "net{}kyori", |
| 81 | + "adventure-api", |
| 82 | + BetterHud.ADVENTURE_VERSION, |
| 83 | + false, |
| 84 | + List.of(BetterHudPlatform.BUKKIT) |
| 85 | + ); |
| 86 | + public static final BetterHudDependency ADVENTURE_KEY = new BetterHudDependency( |
| 87 | + "net{}kyori", |
| 88 | + "adventure-key", |
| 89 | + BetterHud.ADVENTURE_VERSION, |
| 90 | + false, |
| 91 | + List.of(BetterHudPlatform.BUKKIT) |
| 92 | + ); |
| 93 | + public static final BetterHudDependency ADVENTURE_TEXT_LOGGER_SLF4J = new BetterHudDependency( |
| 94 | + "net{}kyori", |
| 95 | + "adventure-text-logger-slf4j", |
| 96 | + BetterHud.ADVENTURE_VERSION, |
| 97 | + false, |
| 98 | + List.of(BetterHudPlatform.BUKKIT) |
| 99 | + ); |
| 100 | + public static final BetterHudDependency ADVENTURE_TEXT_SERIALIZER_ANSI = new BetterHudDependency( |
| 101 | + "net{}kyori", |
| 102 | + "adventure-text-serializer-ansi", |
| 103 | + BetterHud.ADVENTURE_VERSION, |
| 104 | + false, |
| 105 | + List.of(BetterHudPlatform.BUKKIT) |
| 106 | + ); |
| 107 | + public static final BetterHudDependency ADVENTURE_TEXT_SERIALIZER_GSON = new BetterHudDependency( |
| 108 | + "net{}kyori", |
| 109 | + "adventure-text-serializer-gson", |
| 110 | + BetterHud.ADVENTURE_VERSION, |
| 111 | + false, |
| 112 | + List.of(BetterHudPlatform.BUKKIT) |
| 113 | + ); |
| 114 | + public static final BetterHudDependency ADVENTURE_TEXT_SERIALIZER_PLAIN = new BetterHudDependency( |
| 115 | + "net{}kyori", |
| 116 | + "adventure-text-serializer-plain", |
| 117 | + BetterHud.ADVENTURE_VERSION, |
| 118 | + false, |
| 119 | + List.of(BetterHudPlatform.BUKKIT) |
| 120 | + ); |
| 121 | + public static final BetterHudDependency ADVENTURE_TEXT_SERIALIZER_LEGACY = new BetterHudDependency( |
| 122 | + "net{}kyori", |
| 123 | + "adventure-text-serializer-legacy", |
| 124 | + BetterHud.ADVENTURE_VERSION, |
| 125 | + false, |
| 126 | + List.of(BetterHudPlatform.BUKKIT) |
| 127 | + ); |
| 128 | + public static final BetterHudDependency ADVENTURE_TEXT_SERIALIZER_JSON = new BetterHudDependency( |
| 129 | + "net{}kyori", |
| 130 | + "adventure-text-serializer-json", |
| 131 | + BetterHud.ADVENTURE_VERSION, |
| 132 | + false, |
| 133 | + List.of(BetterHudPlatform.BUKKIT) |
| 134 | + ); |
| 135 | + public static final BetterHudDependency ADVENTURE_TEXT_MINIMESSAGE = new BetterHudDependency( |
| 136 | + "net{}kyori", |
| 137 | + "adventure-text-minimessage", |
| 138 | + BetterHud.ADVENTURE_VERSION, |
| 139 | + false, |
| 140 | + List.of(BetterHudPlatform.BUKKIT) |
| 141 | + ); |
| 142 | + public static final BetterHudDependency EXAMINATION_API = new BetterHudDependency( |
| 143 | + "net{}kyori", |
| 144 | + "examination-api", |
| 145 | + BetterHud.EXAMINATION_VERSION, |
| 146 | + false, |
| 147 | + List.of(BetterHudPlatform.BUKKIT) |
| 148 | + ); |
| 149 | + public static final BetterHudDependency EXAMINATION_STRING = new BetterHudDependency( |
| 150 | + "net{}kyori", |
| 151 | + "examination-string", |
| 152 | + BetterHud.EXAMINATION_VERSION, |
| 153 | + false, |
| 154 | + List.of(BetterHudPlatform.BUKKIT) |
| 155 | + ); |
| 156 | + public static final BetterHudDependency OPTION = new BetterHudDependency( |
| 157 | + "net{}kyori", |
| 158 | + "option", |
| 159 | + "1.0.0", |
| 160 | + false, |
| 161 | + List.of(BetterHudPlatform.BUKKIT) |
| 162 | + ); |
| 163 | + public static final BetterHudDependency ADVENTURE_NBT = new BetterHudDependency( |
| 164 | + "net{}kyori", |
| 165 | + "adventure-nbt", |
| 166 | + BetterHud.ADVENTURE_VERSION, |
| 167 | + false, |
| 168 | + List.of(BetterHudPlatform.BUKKIT, BetterHudPlatform.PAPER) |
| 169 | + ); |
| 170 | + public static final BetterHudDependency ADVENTURE_TEXT_SERIALIZER_GSON_LEGACY_IMPL = new BetterHudDependency( |
| 171 | + "net{}kyori", |
| 172 | + "adventure-text-serializer-gson-legacy-impl", |
| 173 | + BetterHud.ADVENTURE_VERSION, |
| 174 | + false, |
| 175 | + List.of(BetterHudPlatform.BUKKIT, BetterHudPlatform.PAPER) |
| 176 | + ); |
| 177 | + public static final BetterHudDependency ADVENTURE_TEXT_SERIALIZER_JSON_LEGACY_IMPL = new BetterHudDependency( |
| 178 | + "net{}kyori", |
| 179 | + "adventure-text-serializer-json-legacy-impl", |
| 180 | + BetterHud.ADVENTURE_VERSION, |
| 181 | + false, |
| 182 | + List.of(BetterHudPlatform.BUKKIT, BetterHudPlatform.PAPER) |
| 183 | + ); |
| 184 | + public static final BetterHudDependency ADVENTURE_PLATFORM_BUKKIT = new BetterHudDependency( |
| 185 | + "net{}kyori", |
| 186 | + "adventure-platform-bukkit", |
| 187 | + BetterHud.PLATFORM_VERSION, |
| 188 | + false, |
| 189 | + List.of(BetterHudPlatform.BUKKIT, BetterHudPlatform.PAPER) |
| 190 | + ); |
| 191 | + public static final BetterHudDependency ADVENTURE_PLATFORM_API = new BetterHudDependency( |
| 192 | + "net{}kyori", |
| 193 | + "adventure-platform-api", |
| 194 | + BetterHud.PLATFORM_VERSION, |
| 195 | + false, |
| 196 | + List.of(BetterHudPlatform.BUKKIT, BetterHudPlatform.PAPER) |
| 197 | + ); |
| 198 | + public static final BetterHudDependency ADVENTURE_PLATFORM_FACET = new BetterHudDependency( |
| 199 | + "net{}kyori", |
| 200 | + "adventure-platform-facet", |
| 201 | + BetterHud.PLATFORM_VERSION, |
| 202 | + false, |
| 203 | + List.of(BetterHudPlatform.BUKKIT, BetterHudPlatform.PAPER) |
| 204 | + ); |
| 205 | +} |
0 commit comments