Skip to content
Permalink
Browse files

Updated Velocity to latest (#216)

* Updated Velocity to latest

Kyori text is the only breaking change, here.

* Updated Velocity scope
  • Loading branch information...
egg82 authored and aikar committed Jun 21, 2019
1 parent 625171b commit 96e5414b12b193146ca0505bcdd93836fb7890a6
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>acf-parent</artifactId>
<groupId>co.aikar</groupId>
<version>0.5.0-SNAPSHOT</version>
@@ -32,7 +32,8 @@
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
@@ -12,13 +12,13 @@
import com.velocitypowered.api.proxy.ProxyServer;

import net.kyori.text.TextComponent;
import net.kyori.text.serializer.ComponentSerializers;
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;

public class ACFVelocityUtil {

@SuppressWarnings("deprecation")
public static TextComponent color(String message) {
return ComponentSerializers.LEGACY.deserialize(message);
return LegacyComponentSerializer.legacy().deserialize(message);
}

public static Player findPlayerSmart(ProxyServer server, CommandIssuer issuer, String search) {
@@ -51,7 +51,7 @@ public static Player findPlayerSmart(ProxyServer server, CommandIssuer issuer, S

/*
* Original code written by md_5
*
*
* Modified to work with Velocity by Crypnotic
*/
private static Collection<Player> matchPlayer(ProxyServer server, final String partialName) {
@@ -1,7 +1,7 @@
package co.aikar.commands;

import net.kyori.text.format.TextColor;
import net.kyori.text.serializer.ComponentSerializers;
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;

public class VelocityMessageFormatter extends MessageFormatter<TextColor> {

@@ -12,6 +12,6 @@ public VelocityMessageFormatter(TextColor... colors) {
@Override
@SuppressWarnings("deprecation")
String format(TextColor color, String message) {
return ComponentSerializers.LEGACY.serialize(ComponentSerializers.LEGACY.deserialize(message).color(color));
return LegacyComponentSerializer.legacy().serialize(LegacyComponentSerializer.legacy().deserialize(message).color(color));
}
}

0 comments on commit 96e5414

Please sign in to comment.
You can’t perform that action at this time.