Skip to content

Commit 64d5824

Browse files
Update dependencies (#763)
* Update dependencies * Use static imports for Assertions * Change commit hash from jitpack
1 parent 6f53d57 commit 64d5824

30 files changed

+124
-125
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ Please join [the GeyserMC Discord server](https://discord.gg/geysermc) and visit
5555

5656
## License
5757

58-
MCProtocolLib is licensed under the **[MIT license](http://www.opensource.org/licenses/mit-license.html)**.
58+
MCProtocolLib is licensed under the **[MIT license](https://opensource.org/license/mit/)**.

pom.xml

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<name>MCProtocolLib</name>
1212
<description>MCProtocolLib is a simple library for communicating with Minecraft clients and servers.</description>
13-
<url>http://github.com/GeyserMC/MCProtocolLib/</url>
13+
<url>https://github.com/GeyserMC/MCProtocolLib/</url>
1414

1515
<scm>
1616
<connection>scm:git:[email protected]:GeyserMC/MCProtocolLib.git</connection>
@@ -20,15 +20,15 @@
2020

2121
<properties>
2222
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
23-
<jdk.version>1.8</jdk.version>
24-
<adventure.version>4.9.3</adventure.version>
25-
<argLine></argLine>
23+
<maven.compiler.source>1.8</maven.compiler.source>
24+
<maven.compiler.target>1.8</maven.compiler.target>
25+
<adventure.version>4.14.0</adventure.version>
2626
</properties>
2727

2828
<licenses>
2929
<license>
3030
<name>MIT</name>
31-
<url>http://www.opensource.org/licenses/mit-license.html</url>
31+
<url>https://opensource.org/license/mit/</url>
3232
<distribution>repo</distribution>
3333
</license>
3434
</licenses>
@@ -81,6 +81,7 @@
8181
</repositories>
8282

8383
<dependencies>
84+
<!-- Minecraft related libraries -->
8485
<dependency>
8586
<groupId>com.github.steveice10</groupId>
8687
<artifactId>opennbt</artifactId>
@@ -90,9 +91,10 @@
9091
<dependency>
9192
<groupId>com.github.GeyserMC</groupId>
9293
<artifactId>mcauthlib</artifactId>
93-
<version>6f3d6aada5</version>
94+
<version>6621fd081c</version>
9495
<scope>compile</scope>
9596
</dependency>
97+
<!-- Kyori adventure -->
9698
<dependency>
9799
<groupId>net.kyori</groupId>
98100
<artifactId>adventure-text-serializer-gson</artifactId>
@@ -105,12 +107,20 @@
105107
<version>${adventure.version}</version>
106108
<scope>compile</scope>
107109
</dependency>
110+
<!-- Lombok and annotations -->
108111
<dependency>
109112
<groupId>org.projectlombok</groupId>
110113
<artifactId>lombok</artifactId>
111-
<version>1.18.22</version>
114+
<version>1.18.30</version>
112115
<scope>provided</scope>
113116
</dependency>
117+
<dependency>
118+
<groupId>com.github.spotbugs</groupId>
119+
<artifactId>spotbugs-annotations</artifactId>
120+
<version>4.7.3</version>
121+
<scope>provided</scope>
122+
</dependency>
123+
<!-- Math utilities -->
114124
<dependency>
115125
<groupId>org.cloudburstmc.math</groupId>
116126
<artifactId>api</artifactId>
@@ -123,48 +133,45 @@
123133
<version>2.0</version>
124134
<scope>compile</scope>
125135
</dependency>
136+
<!-- Stripped down fastutil -->
126137
<dependency>
127138
<groupId>com.nukkitx.fastutil</groupId>
128139
<artifactId>fastutil-object-int-maps</artifactId>
129-
<version>8.5.2</version>
140+
<version>8.5.3</version>
130141
<scope>compile</scope>
131142
</dependency>
132143
<dependency>
133-
<groupId>junit</groupId>
134-
<artifactId>junit</artifactId>
135-
<version>4.13.1</version>
136-
<scope>test</scope>
144+
<groupId>com.nukkitx.fastutil</groupId>
145+
<artifactId>fastutil-int-object-maps</artifactId>
146+
<version>8.5.3</version>
147+
<scope>compile</scope>
137148
</dependency>
149+
<!-- Netty -->
138150
<dependency>
139151
<groupId>io.netty</groupId>
140152
<artifactId>netty-all</artifactId>
141-
<version>4.1.66.Final</version>
153+
<version>4.1.99.Final</version>
142154
<scope>compile</scope>
143155
</dependency>
144156
<dependency>
145157
<groupId>io.netty</groupId>
146158
<artifactId>netty-codec-haproxy</artifactId>
147-
<version>4.1.66.Final</version>
159+
<version>4.1.99.Final</version>
148160
<scope>compile</scope>
149161
<optional>true</optional>
150162
</dependency>
151163
<dependency>
152164
<groupId>io.netty.incubator</groupId>
153165
<artifactId>netty-incubator-transport-native-io_uring</artifactId>
154-
<version>0.0.8.Final</version>
166+
<version>0.0.23.Final</version>
155167
<classifier>linux-x86_64</classifier>
156168
</dependency>
169+
<!-- Test dependencies -->
157170
<dependency>
158-
<groupId>com.github.spotbugs</groupId>
159-
<artifactId>spotbugs-annotations</artifactId>
160-
<version>4.3.0</version>
161-
<scope>provided</scope>
162-
</dependency>
163-
<dependency>
164-
<groupId>com.nukkitx.fastutil</groupId>
165-
<artifactId>fastutil-int-object-maps</artifactId>
166-
<version>8.5.2</version>
167-
<scope>compile</scope>
171+
<groupId>org.junit.jupiter</groupId>
172+
<artifactId>junit-jupiter</artifactId>
173+
<version>5.8.2</version>
174+
<scope>test</scope>
168175
</dependency>
169176
</dependencies>
170177

@@ -174,40 +181,32 @@
174181
<plugin>
175182
<groupId>org.apache.maven.plugins</groupId>
176183
<artifactId>maven-clean-plugin</artifactId>
177-
<version>3.0.0</version>
184+
<version>3.3.1</version>
178185
</plugin>
179186
<plugin>
180187
<groupId>org.apache.maven.plugins</groupId>
181188
<artifactId>maven-resources-plugin</artifactId>
182-
<version>3.0.2</version>
189+
<version>3.3.1</version>
183190
</plugin>
184191
<plugin>
185192
<groupId>org.apache.maven.plugins</groupId>
186193
<artifactId>maven-jar-plugin</artifactId>
187-
<version>3.0.2</version>
194+
<version>3.3.0</version>
188195
</plugin>
189196
<plugin>
190197
<groupId>org.apache.maven.plugins</groupId>
191198
<artifactId>maven-compiler-plugin</artifactId>
192-
<version>3.7.0</version>
193-
<configuration>
194-
<source>${jdk.version}</source>
195-
<target>${jdk.version}</target>
196-
</configuration>
199+
<version>3.11.0</version>
197200
</plugin>
198201
<plugin>
199202
<groupId>org.apache.maven.plugins</groupId>
200203
<artifactId>maven-surefire-plugin</artifactId>
201-
<version>2.22.0</version>
202-
<configuration>
203-
<!-- Force the right file encoding during unit testing -->
204-
<argLine>-Dfile.encoding=${project.build.sourceEncoding} @{argLine}</argLine>
205-
</configuration>
204+
<version>3.1.2</version>
206205
</plugin>
207206
<plugin>
208207
<groupId>org.apache.maven.plugins</groupId>
209208
<artifactId>maven-javadoc-plugin</artifactId>
210-
<version>3.0.1</version>
209+
<version>3.6.0</version>
211210
<executions>
212211
<execution>
213212
<id>attach-javadocs</id>
@@ -225,7 +224,7 @@
225224
<plugin>
226225
<groupId>org.apache.maven.plugins</groupId>
227226
<artifactId>maven-source-plugin</artifactId>
228-
<version>3.0.1</version>
227+
<version>3.3.0</version>
229228
<executions>
230229
<execution>
231230
<id>attach-sources</id>
@@ -238,12 +237,12 @@
238237
<plugin>
239238
<groupId>org.apache.maven.plugins</groupId>
240239
<artifactId>maven-install-plugin</artifactId>
241-
<version>2.5.2</version>
240+
<version>3.1.1</version>
242241
</plugin>
243242
<plugin>
244243
<groupId>org.apache.maven.plugins</groupId>
245244
<artifactId>maven-deploy-plugin</artifactId>
246-
<version>2.8.2</version>
245+
<version>3.1.1</version>
247246
</plugin>
248247
</plugins>
249248
</build>

src/main/java/com/github/steveice10/mc/protocol/data/DefaultComponentSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.github.steveice10.mc.protocol.data;
22

33
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
4-
import net.kyori.adventure.text.serializer.gson.legacyimpl.NBTLegacyHoverEventSerializer;
4+
import net.kyori.adventure.text.serializer.json.legacyimpl.NBTLegacyHoverEventSerializer;
55

66
public final class DefaultComponentSerializer {
77
private static GsonComponentSerializer serializer = GsonComponentSerializer.builder()

src/main/java/com/github/steveice10/mc/protocol/data/game/level/event/BreakBlockEventData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
@Data
88
@AllArgsConstructor
99
public class BreakBlockEventData implements LevelEventData {
10-
private final @NonNull int blockState;
10+
private final int blockState;
1111
}

src/main/java/com/github/steveice10/packetlib/Server.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public interface Server {
7474
* @return Value of the flag.
7575
* @throws IllegalStateException If the flag's value isn't of the required type.
7676
*/
77-
@SuppressWarnings("unchecked")
7877
<T> T getGlobalFlag(String key, T def);
7978

8079
/**
@@ -116,13 +115,16 @@ public interface Server {
116115

117116
/**
118117
* Binds the listener to its host and port.
118+
*
119+
* @return The server.
119120
*/
120121
AbstractServer bind();
121122

122123
/**
123124
* Binds the listener to its host and port.
124125
*
125126
* @param wait Whether to wait for the listener to finish binding.
127+
* @return The server.
126128
*/
127129
AbstractServer bind(boolean wait);
128130

@@ -131,6 +133,7 @@ public interface Server {
131133
*
132134
* @param wait Whether to wait for the listener to finish binding.
133135
* @param callback Callback to call when the listener has finished binding.
136+
* @return The server.
134137
*/
135138
AbstractServer bind(boolean wait, Runnable callback);
136139

src/test/java/com/github/steveice10/mc/protocol/MinecraftProtocolTest.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
import com.github.steveice10.packetlib.tcp.TcpClientSession;
1818
import com.github.steveice10.packetlib.tcp.TcpServer;
1919
import net.kyori.adventure.text.Component;
20-
import org.junit.AfterClass;
21-
import org.junit.BeforeClass;
22-
import org.junit.Test;
20+
import org.junit.jupiter.api.AfterAll;
21+
import org.junit.jupiter.api.BeforeAll;
22+
import org.junit.jupiter.api.Test;
2323

2424
import java.util.ArrayList;
2525
import java.util.concurrent.CountDownLatch;
@@ -30,9 +30,7 @@
3030
import static com.github.steveice10.mc.protocol.MinecraftConstants.SERVER_LOGIN_HANDLER_KEY;
3131
import static com.github.steveice10.mc.protocol.MinecraftConstants.VERIFY_USERS_KEY;
3232
import static java.util.concurrent.TimeUnit.SECONDS;
33-
import static org.junit.Assert.assertEquals;
34-
import static org.junit.Assert.assertNotNull;
35-
import static org.junit.Assert.assertTrue;
33+
import static org.junit.jupiter.api.Assertions.*;
3634

3735
public class MinecraftProtocolTest {
3836
private static final String HOST = "localhost";
@@ -49,7 +47,7 @@ public class MinecraftProtocolTest {
4947

5048
private static Server server;
5149

52-
@BeforeClass
50+
@BeforeAll
5351
public static void setupServer() {
5452
server = new TcpServer(HOST, PORT, MinecraftProtocol::new);
5553
server.setGlobalFlag(VERIFY_USERS_KEY, false);
@@ -66,10 +64,10 @@ public static void setupServer() {
6664
session.send(JOIN_GAME_PACKET);
6765
});
6866

69-
assertTrue("Could not bind server.", server.bind(true).isListening());
67+
assertTrue(server.bind(true).isListening(), "Could not bind server.");
7068
}
7169

72-
@AfterClass
70+
@AfterAll
7371
public static void tearDownServer() {
7472
if (server != null) {
7573
server.close(true);
@@ -87,8 +85,8 @@ public void testStatus() throws InterruptedException {
8785
session.connect();
8886

8987
handler.status.await(4, SECONDS);
90-
assertNotNull("Failed to get server info.", handler.info);
91-
assertEquals("Received incorrect server info.", SERVER_INFO, handler.info);
88+
assertNotNull(handler.info, "Failed to get server info.");
89+
assertEquals(SERVER_INFO, handler.info, "Received incorrect server info.");
9290
} finally {
9391
session.disconnect("Status test complete.");
9492
}
@@ -104,8 +102,8 @@ public void testLogin() throws InterruptedException {
104102
session.connect();
105103

106104
listener.login.await(4, SECONDS);
107-
assertNotNull("Failed to log in.", listener.packet);
108-
assertEquals("Received incorrect join packet.", JOIN_GAME_PACKET, listener.packet);
105+
assertNotNull(listener.packet, "Failed to log in.");
106+
assertEquals(JOIN_GAME_PACKET, listener.packet, "Received incorrect join packet.");
109107
} finally {
110108
session.disconnect("Login test complete.");
111109
}

src/test/java/com/github/steveice10/mc/protocol/data/ChunkTest.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@
88
import io.netty.buffer.ByteBuf;
99
import io.netty.buffer.Unpooled;
1010
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
11-
import org.junit.Assert;
12-
import org.junit.Before;
13-
import org.junit.Test;
11+
import org.junit.jupiter.api.BeforeEach;
12+
import org.junit.jupiter.api.Test;
1413

1514
import java.io.IOException;
1615
import java.util.ArrayList;
1716
import java.util.Collections;
1817
import java.util.List;
1918

19+
import static org.junit.jupiter.api.Assertions.assertEquals;
20+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
21+
2022
public class ChunkTest {
2123
private final List<ChunkSection> chunkSectionsToTest = new ArrayList<>();
2224

23-
@Before
25+
@BeforeEach
2426
public void setup() {
2527
chunkSectionsToTest.add(new ChunkSection());
2628

@@ -49,18 +51,19 @@ public void testChunkSectionEncoding() throws IOException {
4951
e.printStackTrace();
5052
throw e;
5153
}
52-
Assert.assertEquals("Decoded packet does not match original: " + section + " vs " + decoded, section, decoded);
54+
55+
assertEquals(section, decoded, "Decoded packet does not match original: " + section + " vs " + decoded);
5356
}
5457
}
5558

5659
@Test
5760
public void testDeepCopy() {
5861
for (ChunkSection section : chunkSectionsToTest) {
5962
ChunkSection copy = new ChunkSection(section);
60-
Assert.assertEquals("Deep copy does not match original: " + section + " vs " + copy, section, copy);
63+
assertEquals(section, copy, "Deep copy does not match original: " + section + " vs " + copy);
6164

6265
copy.setBlock(1, 1, 1, 10);
63-
Assert.assertNotEquals("Deep copy is not deep: " + section + " vs " + copy, section, copy);
66+
assertNotEquals(section, copy, "Deep copy is not deep: " + section + " vs " + copy);
6467
}
6568
}
6669
}

0 commit comments

Comments
 (0)