Skip to content

Commit

Permalink
Bump adventure version
Browse files Browse the repository at this point in the history
  • Loading branch information
virustotalop committed Dec 16, 2024
1 parent 965daea commit 39d9d2a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
}

def adventureVersion = "4.12.0"
def adventureVersion = "4.17.0"

//tasks.shadowJar.dependsOn ':api:shadowJar'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,27 @@ public void nullTest() throws Exception {
}

@Test
public void dataTest() throws Exception {
public void dataTestPlainText() throws Exception {
this.getFactory().inject();
String data = "test";
Function function = new PlayerMiniMessageFunction();
function.setData(data);
MockPlayerWrapper player = this.getFactory().createPlayer();
assertTrue(function.function(player));
assertEquals(1, player.getIncomingChat().size());
assertEquals("{\"text\":\"test\"}", player.getIncomingChat().get(0));
assertEquals("\"test\"", player.getIncomingChat().get(0));
}

@Test
public void dataTestJsonText() throws Exception {
this.getFactory().inject();
String data = "<red>test</red>";
Function function = new PlayerMiniMessageFunction();
function.setData(data);
MockPlayerWrapper player = this.getFactory().createPlayer();
assertTrue(function.function(player));
assertEquals(1, player.getIncomingChat().size());
System.out.println(player.getIncomingChat());
assertEquals("{\"color\":\"red\",\"text\":\"test\"}", player.getIncomingChat().get(0));
}
}

0 comments on commit 39d9d2a

Please sign in to comment.