mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-12 12:33:54 +00:00
Shade in Kashike's lib
This commit is contained in:
@ -26,6 +26,8 @@ import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.auth.AuthorizationException;
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.spongeapi.TextAdapter;
|
||||
import org.spongepowered.api.command.CommandSource;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
import org.spongepowered.api.text.Text;
|
||||
@ -89,6 +91,11 @@ public class SpongeCommandSender implements Actor {
|
||||
sendColorized(msg, TextColors.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(TextComponent component) {
|
||||
TextAdapter.sendComponent(sender, component);
|
||||
}
|
||||
|
||||
private void sendColorized(String msg, TextColor formatting) {
|
||||
for (String part : msg.split("\n")) {
|
||||
sender.sendMessage(Text.of(formatting, TextSerializers.LEGACY_FORMATTING_CODE.deserialize(part)));
|
||||
|
@ -36,6 +36,8 @@ import com.sk89q.worldedit.world.gamemode.GameMode;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
|
||||
import net.kyori.text.TextComponent;
|
||||
import net.kyori.text.adapter.spongeapi.TextAdapter;
|
||||
import org.spongepowered.api.Sponge;
|
||||
import org.spongepowered.api.data.type.HandTypes;
|
||||
import org.spongepowered.api.entity.living.player.Player;
|
||||
@ -149,6 +151,11 @@ public class SpongePlayer extends AbstractPlayerActor {
|
||||
sendColorized(msg, TextColors.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(TextComponent component) {
|
||||
TextAdapter.sendComponent(player, component);
|
||||
}
|
||||
|
||||
private void sendColorized(String msg, TextColor formatting) {
|
||||
for (String part : msg.split("\n")) {
|
||||
this.player.sendMessage(Text.of(formatting, TextSerializers.FORMATTING_CODE.deserialize(part)));
|
||||
|
Reference in New Issue
Block a user