@@ -59,6 +59,8 @@ import org.bukkit.util.BoundingBox;
|
||||
import org.bukkit.util.NumberConversions;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
||||
|
||||
public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
private static PermissibleBase perm;
|
||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
@@ -897,6 +899,26 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
// Spigot start
|
||||
private final org.bukkit.entity.Entity.Spigot spigot = new org.bukkit.entity.Entity.Spigot()
|
||||
{
|
||||
|
||||
@Override
|
||||
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent component)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(UUID sender, BaseComponent... components)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(UUID sender, BaseComponent component)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
public org.bukkit.entity.Entity.Spigot spigot()
|
||||
|
||||
@@ -196,6 +196,8 @@ import org.bukkit.profile.PlayerProfile;
|
||||
import org.bukkit.scoreboard.Scoreboard;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import net.md_5.bungee.api.chat.BaseComponent; // Spigot
|
||||
|
||||
@DelegateDeserialization(CraftOfflinePlayer.class)
|
||||
public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private long firstPlayed = 0;
|
||||
@@ -2381,6 +2383,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
return java.util.Collections.unmodifiableSet( ret );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(BaseComponent component) {
|
||||
this.sendMessage( new BaseComponent[] { component } );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(BaseComponent... components) {
|
||||
this.sendMessage(net.md_5.bungee.api.ChatMessageType.SYSTEM, components);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(UUID sender, BaseComponent component) {
|
||||
this.sendMessage(net.md_5.bungee.api.ChatMessageType.CHAT, sender, component);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(UUID sender, BaseComponent... components) {
|
||||
this.sendMessage(net.md_5.bungee.api.ChatMessageType.CHAT, sender, components);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent component) {
|
||||
this.sendMessage( position, new BaseComponent[] { component } );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent... components) {
|
||||
this.sendMessage(position, null, components);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(net.md_5.bungee.api.ChatMessageType position, UUID sender, BaseComponent component) {
|
||||
this.sendMessage( position, sender, new BaseComponent[] { component } );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendMessage(net.md_5.bungee.api.ChatMessageType position, UUID sender, BaseComponent... components) {
|
||||
if ( CraftPlayer.this.getHandle().connection == null ) return;
|
||||
|
||||
CraftPlayer.this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(components, position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR));
|
||||
}
|
||||
};
|
||||
|
||||
public Player.Spigot spigot()
|
||||
|
||||
Reference in New Issue
Block a user