Contents
Class UISurface.Batch
java.lang.Object
com.hypixel.hytale.server.core.modules.ui.UISurface.Batch
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
UISurface
Collects commands emitted by a surface and sends them as one packet when closed. A batch
larger than the per-packet command cap is sent as several packets, in order. Obtain one via
UISurface.beginBatch() and use it with try-with-resources. An empty batch sends
nothing.-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ServersideUICommand command) voidaddFirst(ServersideUICommand command) Inserts a command at the front of this batch.voidclear()Drops every collected command without sending.voidclose()voidflush()Sends the accumulated commands now and clears the batch, leaving it open to collect more.
-
Method Details
-
add
-
addFirst
Inserts a command at the front of this batch. Used soInitServersideUICommandleads the packet whencreateDataContextemits updates while the batch is open. -
clear
public void clear()Drops every collected command without sending. Use when a lifecycle callback fails before the batch should reach the client. -
flush
public void flush()Sends the accumulated commands now and clears the batch, leaving it open to collect more. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-