Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-24 15:20:15 +01:00
Merge pull request #1319 from KennyTV/master
Update text usage for latest Velocity build
Dieser Commit ist enthalten in:
Commit
256839765a
@ -54,7 +54,7 @@
|
||||
<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>
|
||||
|
@ -11,7 +11,7 @@ import com.velocitypowered.api.plugin.annotation.DataDirectory;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import lombok.Getter;
|
||||
import net.kyori.text.serializer.ComponentSerializers;
|
||||
import net.kyori.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.chat.ComponentSerializer;
|
||||
import org.slf4j.Logger;
|
||||
@ -148,7 +148,7 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
||||
@Override
|
||||
public void sendMessage(UUID uuid, String message) {
|
||||
PROXY.getPlayer(uuid).ifPresent(it -> it.sendMessage(
|
||||
ComponentSerializers.JSON.deserialize(
|
||||
GsonComponentSerializer.INSTANCE.deserialize(
|
||||
ComponentSerializer.toString(TextComponent.fromLegacyText(message)) // Fixes links
|
||||
)
|
||||
));
|
||||
@ -158,8 +158,8 @@ public class VelocityPlugin implements ViaPlatform<Player> {
|
||||
public boolean kickPlayer(UUID uuid, String message) {
|
||||
return PROXY.getPlayer(uuid).map(it -> {
|
||||
it.disconnect(
|
||||
ComponentSerializers.JSON.deserialize(
|
||||
ComponentSerializer.toString(TextComponent.fromLegacyText(message)) // ComponentSerializers.LEGACY is deprecated
|
||||
GsonComponentSerializer.INSTANCE.deserialize(
|
||||
ComponentSerializer.toString(TextComponent.fromLegacyText(message))
|
||||
)
|
||||
);
|
||||
return true;
|
||||
|
@ -3,7 +3,7 @@ package us.myles.ViaVersion.velocity.command;
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
import lombok.AllArgsConstructor;
|
||||
import net.kyori.text.serializer.ComponentSerializers;
|
||||
import net.kyori.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.md_5.bungee.chat.ComponentSerializer;
|
||||
import us.myles.ViaVersion.api.command.ViaCommandSender;
|
||||
@ -22,7 +22,7 @@ public class VelocityCommandSender implements ViaCommandSender {
|
||||
@Override
|
||||
public void sendMessage(String msg) {
|
||||
source.sendMessage(
|
||||
ComponentSerializers.JSON.deserialize(
|
||||
GsonComponentSerializer.INSTANCE.deserialize(
|
||||
ComponentSerializer.toString(TextComponent.fromLegacyText(msg)) // Fixes links
|
||||
)
|
||||
);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren