From 8ef2835a47577c2ce7b0dfc61d0cbd835a99281f Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sun, 28 Jun 2020 21:44:44 -0400 Subject: [PATCH] Fix API breaking change, deprecate ProxyAudience --- .../com/velocitypowered/api/command/CommandSource.java | 7 +++++++ .../java/com/velocitypowered/api/proxy/ProxyAudience.java | 3 +++ 2 files changed, 10 insertions(+) diff --git a/api/src/main/java/com/velocitypowered/api/command/CommandSource.java b/api/src/main/java/com/velocitypowered/api/command/CommandSource.java index 82f7beb0d..63fa4bee4 100644 --- a/api/src/main/java/com/velocitypowered/api/command/CommandSource.java +++ b/api/src/main/java/com/velocitypowered/api/command/CommandSource.java @@ -2,7 +2,9 @@ package com.velocitypowered.api.command; import com.velocitypowered.api.permission.PermissionSubject; import com.velocitypowered.api.proxy.ProxyAudience; +import com.velocitypowered.api.util.AdventureCompat; import net.kyori.adventure.text.Component; +import org.checkerframework.checker.nullness.qual.NonNull; /** * Represents something that can be used to run a {@link Command}. @@ -17,4 +19,9 @@ public interface CommandSource extends PermissionSubject, ProxyAudience { */ @Deprecated void sendMessage(net.kyori.text.Component component); + + @Override + default void sendMessage(@NonNull Component message) { + this.sendMessage(AdventureCompat.asOriginalTextComponent(message)); + } } diff --git a/api/src/main/java/com/velocitypowered/api/proxy/ProxyAudience.java b/api/src/main/java/com/velocitypowered/api/proxy/ProxyAudience.java index 6a64da885..36ff915a5 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/ProxyAudience.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/ProxyAudience.java @@ -13,7 +13,10 @@ import org.checkerframework.checker.nullness.qual.NonNull; * Indicates an {@link Audience} that is on the proxy. This interface contains no-op default methods * that are used to bridge compatibility issues with the new adventure API. This interface will go * away in Velocity 2.0.0. + * + * @deprecated Only used to handle compatibility problems, will go away in Velocity 2.0.0 */ +@Deprecated public interface ProxyAudience extends Audience { @Override