Interface IPipelineContext
IPipelineNode
's,
it is created for every flush and is passed to every node.
WARNING: This context is not thread-safe and should only be used on a single thread.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addReceiver
(org.bukkit.entity.Player... players) Adds one or more specified players as receivers.boolean
void
buffering
(boolean buffering) This enables per player buffering.
If this is enabled, updates in this context will be buffered with an on-disk temporary file cache for each player.boolean
bundling()
void
bundling
(boolean bundling) This enables packet bundling.void
Clears all currently set receivers.AConverter
is used for converting the RGB buffer to minecraft map colors.
These can be used e.g.void
org.bukkit.map.MapCursorCollection
cursors()
MapCursor
's are used for displaying e.g.default IMapDisplay
display()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
isReceiver
(org.bukkit.entity.Player player) @Nullable FullSpacedColorBuffer
The previous buffer is used for getting the changed section.void
previousBuffer
(@Nullable FullSpacedColorBuffer previousBuffer) Set
<org.bukkit.entity.Player> The receivers are used for determining which players will receive the update.
Receivers are used for sending different images on the same display to different players.void
receivers
(Collection<? extends org.bukkit.entity.Player> receivers) Replaces the receivers with the specified collection of receivers.void
removeReceiver
(org.bukkit.entity.Player... players) Removes one or more specified players from receivers.int
z()
void
z
(int z)
-
Method Details
-
receivers
Set<org.bukkit.entity.Player> receivers()The receivers are used for determining which players will receive the update.
Receivers are used for sending different images on the same display to different players.- Returns:
- a modifiable
Set
of receivers
-
receivers
Replaces the receivers with the specified collection of receivers. -
addReceiver
void addReceiver(org.bukkit.entity.Player... players) Adds one or more specified players as receivers. -
removeReceiver
void removeReceiver(org.bukkit.entity.Player... players) Removes one or more specified players from receivers. -
isReceiver
boolean isReceiver(org.bukkit.entity.Player player) - Returns:
- if the specified player is a receiver at the moment
-
clearReceivers
void clearReceivers()Clears all currently set receivers. -
display
Deprecated, for removal: This API element is subject to removal in a future version.usegetDisplay()
instead- Returns:
- the
IMapDisplay
associated with this context
-
getDisplay
IDisplay getDisplay()- Returns:
- the
IDisplay
associated with this context
-
buffering
boolean buffering() -
buffering
void buffering(boolean buffering) This enables per player buffering.
If this is enabled, updates in this context will be buffered with an on-disk temporary file cache for each player.If buffering is turned on, only changes flushed through the pipeline will actually be sent to the player. This improves performance for map display flushing on poor internet connections, but increases IO- and CPU-time.
This is recommended for large displays which update often, with very small difference in content.
If you want manual control over the buffering, you can use
previousBuffer()
to set the previous buffer. This will only update the changed section, but it takes no account if the player has already seen the previous buffer.- Parameters:
buffering
- true if per player buffering should be enabled
-
bundling
boolean bundling() -
bundling
void bundling(boolean bundling) This enables packet bundling.If bundling is turned on, all packets sent to the player will be bundled into one packet. This can improve tearing issues on slow internet connections.
It's not recommended to use this if you update the display very often. This can block the connection for a long time and can cause the player to time out or connection lag spikes.
- Parameters:
bundling
- true if per player bundling should be enabled
-
z
int z()- Returns:
- the z-layer index updated with this pipeline
- See Also:
-
z
void z(int z) - Parameters:
z
- the new z-layer index updated with this pipeline- See Also:
-
cursors
org.bukkit.map.MapCursorCollection cursors()MapCursor
's are used for displaying e.g. arrows and other vanilla decorations on maps.- Returns:
- a modifiable
MapCursorCollection
-
converter
Converter converter()AConverter
is used for converting the RGB buffer to minecraft map colors.
These can be used e.g. for applying dithering to the buffer (Converter.FLOYD_STEINBERG
).- Returns:
- the current
Converter
for this context
-
converter
- Parameters:
converter
- the newConverter
to be set in this context- See Also:
-
previousBuffer
The previous buffer is used for getting the changed section. If this is not set, everything will update.
Also, it takes no account if the player has already seen the previous buffer.
Buffering must be disabled for this to work.
buffering(boolean)
for more info. -
previousBuffer
- See Also:
-
mapEngineApi
MapEngineApi mapEngineApi()- Returns:
- the
MapEngineApi
instance
-
getDisplay()
instead