public class GeyserSession extends Object implements CommandSender
| Constructor and Description |
|---|
GeyserSession(GeyserConnector connector,
com.nukkitx.protocol.bedrock.BedrockServerSession bedrockServerSession) |
| Modifier and Type | Method and Description |
|---|---|
void |
addInventoryTask(Runnable task)
Adds a new inventory task.
|
void |
addInventoryTask(Runnable task,
long delayMillis)
Adds a new inventory task with a delay.
|
void |
addTeleport(TeleportCache teleportCache) |
void |
authenticate(String username) |
void |
authenticate(String username,
String password) |
void |
authenticateWithMicrosoftCode()
Present a form window to the user asking to log in with another web browser
|
void |
close() |
boolean |
confirmTeleport(com.nukkitx.math.vector.Vector3d position) |
void |
connect()
Send all necessary packets to load Bedrock into the server
|
protected void |
disableSrvResolving()
Will be overwritten for GeyserConnect.
|
void |
disconnect(String reason) |
String |
getLocale()
Returns the locale of the command sender.
|
String |
getName() |
int |
getNextItemNetId() |
InetSocketAddress |
getSocketAddress() |
Boolean |
hasPermission(String permission)
Checks if the given session's player has a permission
|
boolean |
isConsole() |
void |
login() |
void |
refreshEmotes(List<UUID> emotes) |
void |
sendAdventureSettings()
Send an AdventureSettingsPacket to the client with the latest flags
|
void |
sendDownstreamPacket(com.github.steveice10.packetlib.packet.Packet packet)
Send a packet to the remote server.
|
void |
sendForm(FormWindow window) |
void |
sendForm(FormWindow window,
int id) |
void |
sendGameRule(String gameRule,
Object value)
Send a gamerule value to the client
|
void |
sendMessage(String message) |
void |
sendUpstreamPacket(com.nukkitx.protocol.bedrock.BedrockPacket packet)
Queue a packet to be sent to player.
|
void |
sendUpstreamPacketImmediately(com.nukkitx.protocol.bedrock.BedrockPacket packet)
Send a packet immediately to the player.
|
void |
setAuthenticationData(AuthData authData) |
void |
setDaylightCycle(boolean doCycle)
Changes the daylight cycle gamerule on the client
This is used in the login screen along-side normal usage
|
void |
setReducedDebugInfo(boolean value)
Update the cached value for the reduced debug info gamerule.
|
void |
setRenderDistance(int renderDistance) |
void |
setSneaking(boolean sneaking) |
void |
tick()
Called every 50 milliseconds - one Minecraft tick.
|
void |
updateStatistics(@NonNull Map<com.github.steveice10.mc.protocol.data.game.statistic.Statistic,Integer> statistics)
Used for updating statistic values since we only get changes from the server
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendMessagepublic GeyserSession(GeyserConnector connector, com.nukkitx.protocol.bedrock.BedrockServerSession bedrockServerSession)
public void connect()
public void login()
public void authenticate(String username)
public void authenticateWithMicrosoftCode()
public void disconnect(String reason)
public void close()
public void tick()
public void setAuthenticationData(AuthData authData)
public void setSneaking(boolean sneaking)
protected void disableSrvResolving()
public String getName()
getName in interface CommandSenderpublic void sendMessage(String message)
sendMessage in interface CommandSenderpublic boolean isConsole()
isConsole in interface CommandSenderpublic String getLocale()
CommandSenderLanguageUtils.getDefaultLocale().getLocale in interface CommandSenderpublic void sendForm(FormWindow window, int id)
public void setRenderDistance(int renderDistance)
public InetSocketAddress getSocketAddress()
public void sendForm(FormWindow window)
public void addInventoryTask(Runnable task)
task - the task to runpublic void addInventoryTask(Runnable task, long delayMillis)
task - the delayed task to rundelayMillis - delay in millisecondspublic int getNextItemNetId()
public void addTeleport(TeleportCache teleportCache)
public boolean confirmTeleport(com.nukkitx.math.vector.Vector3d position)
public void sendUpstreamPacket(com.nukkitx.protocol.bedrock.BedrockPacket packet)
packet - the bedrock packet from the NukkitX protocol libpublic void sendUpstreamPacketImmediately(com.nukkitx.protocol.bedrock.BedrockPacket packet)
packet - the bedrock packet from the NukkitX protocol libpublic void sendDownstreamPacket(com.github.steveice10.packetlib.packet.Packet packet)
packet - the java edition packet from MCProtocolLibpublic void setReducedDebugInfo(boolean value)
value - The new value for reducedDebugInfopublic void setDaylightCycle(boolean doCycle)
doCycle - If the cycle should continuepublic void sendGameRule(String gameRule, Object value)
gameRule - The gamerule to sendvalue - The value of the gamerulepublic Boolean hasPermission(String permission)
permission - The permission node to checkpublic void sendAdventureSettings()
public void updateStatistics(@NonNull
@NonNull Map<com.github.steveice10.mc.protocol.data.game.statistic.Statistic,Integer> statistics)
statistics - Updated statistics valuesCopyright © 2021 GeyserMC. All rights reserved.