Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit ef164aa

Browse files
committed
Update for 1.17
1 parent e83039d commit ef164aa

File tree

5 files changed

+30
-15
lines changed

5 files changed

+30
-15
lines changed

build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group 'com.danifoldi'
7-
version '1.2.2'
7+
version '1.2.4'
88
sourceCompatibility = JavaVersion.VERSION_11
99

1010
repositories {
@@ -28,11 +28,10 @@ dependencies {
2828
exclude module: 'snakeyaml'
2929
}
3030

31-
implementation'org.jetbrains:annotations:20.1.0'
31+
compileOnly 'org.jetbrains:annotations:20.1.0'
3232
implementation 'javax.inject:javax.inject:1'
3333
implementation 'com.google.dagger:dagger:2.37'
3434
annotationProcessor 'com.google.dagger:dagger-compiler:2.37'
35-
3635
}
3736

3837
processResources {
@@ -50,5 +49,7 @@ shadowJar {
5049
relocate 'org.jetbrains.annotations', 'com.danifoldi.bungeegui.lib.annotations'
5150
relocate 'javax.inject', 'com.danifoldi.bungeegui.lib.inject'
5251
relocate 'dagger', 'com.danifoldi.bungeegui.lib.dagger'
52+
relocate 'com.electronwill.night-config', 'com.danifoldi.bungeegui.lib.nightconfig'
53+
5354
archiveFileName.set("${project.name}-${project.version}.jar")
5455
}

src/main/java/com/danifoldi/bungeegui/gui/GuiGrid.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
import java.util.stream.Collectors;
1010

1111
public class GuiGrid {
12-
private final Map<Integer, GuiItem> items;
12+
private final @NotNull Map<Integer, GuiItem> items;
1313
private final boolean isTargeted;
14-
private final List<String> commandAliases;
15-
private final String permission;
14+
private final @NotNull List<String> commandAliases;
15+
private final @NotNull String permission;
1616
private final int guiSize;
17-
private final String title;
17+
private final @NotNull String title;
1818
private final boolean selfTarget;
1919
private final boolean ignoreVanished;
2020
private final boolean requireOnlineTarget;
21-
private final List<String> whitelistServers;
22-
private final List<String> blacklistServers;
21+
private final @NotNull List<String> whitelistServers;
22+
private final @NotNull List<String> blacklistServers;
2323
private final boolean placeholdersTarget;
2424
private final @Nullable GuiSound openSound;
2525
private final boolean targetBypass;

src/main/java/com/danifoldi/bungeegui/gui/GuiItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class GuiItem {
1414
private final int amount;
1515
private final @NotNull String name;
1616
private final @NotNull List<String> lore;
17-
private final String data;
17+
private final @NotNull String data;
1818
private final @NotNull List<String> commands;
1919
private final boolean enchanted;
2020
private final @Nullable GuiSound clickSound;

src/main/java/com/danifoldi/bungeegui/util/VanishUtil.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
import net.md_5.bungee.api.ProxyServer;
55
import net.md_5.bungee.api.connection.ProxiedPlayer;
66
import net.md_5.bungee.api.plugin.Plugin;
7+
import org.jetbrains.annotations.NotNull;
8+
import org.jetbrains.annotations.Nullable;
79

810
public class VanishUtil {
9-
public static boolean isVanished(ProxiedPlayer player) {
10-
Plugin premiumvanishPlugin = ProxyServer.getInstance().getPluginManager().getPlugin("PremiumVanish");
11+
public static boolean isVanished(final @NotNull ProxiedPlayer player) {
12+
final @Nullable Plugin premiumvanishPlugin = ProxyServer.getInstance().getPluginManager().getPlugin("PremiumVanish");
1113
if (premiumvanishPlugin == null) {
1214
return false;
1315
}

src/main/java/com/danifoldi/bungeegui/util/VersionUtil.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.danifoldi.bungeegui.util;
22

3+
import org.jetbrains.annotations.NotNull;
4+
35
import java.util.Arrays;
46

57
public enum VersionUtil {
68
UNKNOWN (999),
9+
v1_17 (755),
710
v1_16_5 (754),
811
v1_16_4 (754),
912
v1_16_3 (753),
@@ -35,6 +38,15 @@ public enum VersionUtil {
3538
v1_9_2 (109),
3639
v1_9_1 (108),
3740
v1_9 (107),
41+
v1_8_9 (47),
42+
v1_8_8 (47),
43+
v1_8_7 (47),
44+
v1_8_6 (47),
45+
v1_8_5 (47),
46+
v1_8_4 (47),
47+
v1_8_3 (47),
48+
v1_8_2 (47),
49+
v1_8_1 (47),
3850
v1_8 (47),
3951
v1_7_10 (5),
4052
v1_7_9 (5),
@@ -55,15 +67,15 @@ public enum VersionUtil {
5567

5668
private final int protocolVersion;
5769

58-
VersionUtil(int protocolVersion) {
70+
VersionUtil(final int protocolVersion) {
5971
this.protocolVersion = protocolVersion;
6072
}
6173

62-
public static VersionUtil find(int protocolVersion) {
74+
public static @NotNull VersionUtil find(final int protocolVersion) {
6375
return Arrays.stream(VersionUtil.values()).filter(p -> p.protocolVersion == protocolVersion).findFirst().orElse(UNKNOWN);
6476
}
6577

66-
public String getVersion() {
78+
public @NotNull String getVersion() {
6779
for (VersionUtil version: VersionUtil.values()) {
6880
if (version.protocolVersion == protocolVersion) {
6981
return version.toString().replace("v", "").replace("_", ".");

0 commit comments

Comments
 (0)