Constructor and Description |
---|
BukkitViaAPI(ViaVersionPlugin plugin) |
Modifier and Type | Method and Description |
---|---|
BossBar<org.bukkit.entity.Player> |
createBossBar(String title,
BossColor color,
BossStyle style)
Create a new bossbar instance
|
BossBar<org.bukkit.entity.Player> |
createBossBar(String title,
float health,
BossColor color,
BossStyle style)
Create a new bossbar instance
|
int |
getPlayerVersion(org.bukkit.entity.Player player)
Get protocol number from a player
Will also retrieve version from ProtocolSupport if it's being used.
|
int |
getPlayerVersion(UUID uuid)
Get protocol number from a player
|
SortedSet<Integer> |
getSupportedVersions()
Get the supported protocol versions
This method removes any blocked protocol versions.
|
String |
getVersion()
Get the version of the plugin
|
boolean |
isCompatSpigotBuild()
Returns if this version is a compatibility build for spigot.
|
boolean |
isInjected(UUID playerUUID)
Returns if Via injected into this player connection
|
boolean |
isProtocolSupport()
Returns if ProtocolSupport is also being used.
|
void |
sendRawPacket(org.bukkit.entity.Player player,
io.netty.buffer.ByteBuf packet)
Send a raw packet to the player (Use new IDs)
|
void |
sendRawPacket(UUID uuid,
io.netty.buffer.ByteBuf packet)
Send a raw packet to the player (Use new IDs)
|
public BukkitViaAPI(ViaVersionPlugin plugin)
public int getPlayerVersion(org.bukkit.entity.Player player)
ViaAPI
getPlayerVersion
in interface ViaAPI<org.bukkit.entity.Player>
player
- Platform player object, eg. Bukkit this is Playerpublic int getPlayerVersion(UUID uuid)
ViaAPI
getPlayerVersion
in interface ViaAPI<org.bukkit.entity.Player>
uuid
- UUID of a playerpublic boolean isInjected(UUID playerUUID)
ViaAPI
isInjected
in interface ViaAPI<org.bukkit.entity.Player>
playerUUID
- UUID of a playerpublic String getVersion()
ViaAPI
getVersion
in interface ViaAPI<org.bukkit.entity.Player>
public void sendRawPacket(UUID uuid, io.netty.buffer.ByteBuf packet) throws IllegalArgumentException
ViaAPI
sendRawPacket
in interface ViaAPI<org.bukkit.entity.Player>
uuid
- The uuid from the player to send packetpacket
- The packet, you need a VarInt ID then the packet contents.IllegalArgumentException
- if the player is not injected by Viapublic void sendRawPacket(org.bukkit.entity.Player player, io.netty.buffer.ByteBuf packet) throws IllegalArgumentException
ViaAPI
sendRawPacket
in interface ViaAPI<org.bukkit.entity.Player>
player
- Platform player object, eg. Bukkit this is Playerpacket
- The packet, you need a VarInt ID then the packet contents.IllegalArgumentException
- if the player is not injected by Viapublic BossBar<org.bukkit.entity.Player> createBossBar(String title, BossColor color, BossStyle style)
ViaAPI
createBossBar
in interface ViaAPI<org.bukkit.entity.Player>
title
- The titlecolor
- The colorstyle
- The stylepublic BossBar<org.bukkit.entity.Player> createBossBar(String title, float health, BossColor color, BossStyle style)
ViaAPI
createBossBar
in interface ViaAPI<org.bukkit.entity.Player>
title
- The titlehealth
- Number between 0 and 1color
- The colorstyle
- The stylepublic SortedSet<Integer> getSupportedVersions()
ViaAPI
getSupportedVersions
in interface ViaAPI<org.bukkit.entity.Player>
for full list.
public boolean isCompatSpigotBuild()
public boolean isProtocolSupport()
Copyright © 2016–2021. All rights reserved.