Skip to content

Commit 25c9ee7

Browse files
committed
update to Java 17 again
1 parent 4f2a36b commit 25c9ee7

File tree

12 files changed

+14
-25
lines changed

12 files changed

+14
-25
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
uses: actions/setup-java@v3
1919
with:
2020
distribution: 'temurin'
21-
java-version: '8'
21+
java-version: '17'
2222
- name: Grant execute permission for gradlew
2323
run: chmod +x gradlew
2424
- name: Build Release Artifacts with Gradle

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ the [LabyMod Developer Portal](https://wiki.labymod.net).
3636

3737
### Prerequisites
3838

39-
- Java Development Kit (JDK) 8 or higher
39+
- Java Development Kit (JDK) 17 or higher
4040

4141
### Steps
4242

api/src/main/java/net/labymod/serverapi/api/payload/io/PayloadWriter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ public void writeOptionalString(@Nullable String value) {
187187
public void writeComponent(@NotNull ServerAPIComponent component) {
188188
byte id = 0;
189189
Consumer<PayloadWriter> dataWriter = null;
190-
if (component instanceof ServerAPITextComponent) {
191-
ServerAPITextComponent textComponent = (ServerAPITextComponent) component;
190+
if (component instanceof ServerAPITextComponent textComponent) {
192191
if (!textComponent.getText().isEmpty()) {
193192
id = 1;
194193
dataWriter = writer -> writer.writeString(textComponent.getText());

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ subprojects {
6262
}
6363

6464
java {
65-
sourceCompatibility = JavaVersion.VERSION_1_8
66-
targetCompatibility = JavaVersion.VERSION_1_8
65+
sourceCompatibility = JavaVersion.VERSION_17
66+
targetCompatibility = JavaVersion.VERSION_17
6767
}
6868

6969
fun adjustArchiveFileName(property: Property<String>) {

core/src/main/java/net/labymod/serverapi/core/model/display/EconomyDisplay.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ public boolean equals(Object o) {
7878
return true;
7979
}
8080

81-
if (!(o instanceof EconomyDisplay)) {
81+
if (!(o instanceof EconomyDisplay that)) {
8282
return false;
8383
}
8484

85-
EconomyDisplay that = (EconomyDisplay) o;
8685
return this.visible == that.visible && Double.compare(this.balance, that.balance) == 0
8786
&& Objects.equals(this.key, that.key) && Objects.equals(this.iconUrl, that.iconUrl)
8887
&& Objects.equals(this.decimalFormat, that.decimalFormat);
@@ -121,11 +120,10 @@ public boolean equals(Object o) {
121120
return true;
122121
}
123122

124-
if (!(o instanceof DecimalFormat)) {
123+
if (!(o instanceof DecimalFormat that)) {
125124
return false;
126125
}
127126

128-
DecimalFormat that = (DecimalFormat) o;
129127
return Double.compare(this.divisor, that.divisor) == 0 && Objects.equals(this.format,
130128
that.format);
131129
}

core/src/main/java/net/labymod/serverapi/core/model/feature/Emote.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,10 @@ public boolean equals(Object o) {
5858
return true;
5959
}
6060

61-
if (!(o instanceof Emote)) {
61+
if (!(o instanceof Emote emote)) {
6262
return false;
6363
}
6464

65-
Emote emote = (Emote) o;
6665
return this.emoteId == emote.emoteId && Objects.equals(this.uniqueId, emote.uniqueId);
6766
}
6867

core/src/main/java/net/labymod/serverapi/core/model/feature/InteractionMenuEntry.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,10 @@ public boolean equals(Object o) {
101101
return true;
102102
}
103103

104-
if (!(o instanceof InteractionMenuEntry)) {
104+
if (!(o instanceof InteractionMenuEntry that)) {
105105
return false;
106106
}
107107

108-
InteractionMenuEntry that = (InteractionMenuEntry) o;
109108
return Objects.equals(this.displayName, that.displayName) && this.type == that.type
110109
&& Objects.equals(this.value, that.value) && Objects.equals(this.iconUrl,
111110
that.iconUrl);

core/src/main/java/net/labymod/serverapi/core/model/moderation/Permission.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,10 @@ public boolean equals(Object o) {
8383
return true;
8484
}
8585

86-
if (!(o instanceof Permission)) {
86+
if (!(o instanceof Permission that)) {
8787
return false;
8888
}
8989

90-
Permission that = (Permission) o;
9190
return this.identifier.equals(that.identifier);
9291
}
9392

core/src/main/java/net/labymod/serverapi/core/model/moderation/RecommendedAddon.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ public boolean equals(Object o) {
7070
return true;
7171
}
7272

73-
if (!(o instanceof RecommendedAddon)) {
73+
if (!(o instanceof RecommendedAddon that)) {
7474
return false;
7575
}
7676

77-
RecommendedAddon that = (RecommendedAddon) o;
7877
return this.required == that.required && Objects.equals(this.namespace, that.namespace);
7978
}
8079

core/src/main/java/net/labymod/serverapi/core/model/supplement/InputPrompt.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,10 @@ public boolean equals(Object o) {
126126
return true;
127127
}
128128

129-
if (!(o instanceof InputPrompt)) {
129+
if (!(o instanceof InputPrompt that)) {
130130
return false;
131131
}
132132

133-
InputPrompt that = (InputPrompt) o;
134133
return this.maxLength == that.maxLength
135134
&& Objects.equals(this.title, that.title)
136135
&& Objects.equals(this.placeholder, that.placeholder)

0 commit comments

Comments
 (0)