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 TypeMethodDescriptionvoidaddReceiver(org.bukkit.entity.Player... players) Adds one or more specified players as receivers.booleanvoidbuffering(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.booleanbundling()voidbundling(boolean bundling) This enables packet bundling.voidClears all currently set receivers.AConverteris used for converting the RGB buffer to minecraft map colors.
These can be used e.g.voidorg.bukkit.map.MapCursorCollectioncursors()MapCursor's are used for displaying e.g.default IMapDisplaydisplay()Deprecated, for removal: This API element is subject to removal in a future version.booleanisReceiver(org.bukkit.entity.Player player) @Nullable FullSpacedColorBufferThe previous buffer is used for getting the changed section.voidpreviousBuffer(@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.voidreceivers(Collection<? extends org.bukkit.entity.Player> receivers) Replaces the receivers with the specified collection of receivers.voidremoveReceiver(org.bukkit.entity.Player... players) Removes one or more specified players from receivers.intz()voidz(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
Setof 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
IMapDisplayassociated with this context
-
getDisplay
IDisplay getDisplay()- Returns:
- the
IDisplayassociated 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()AConverteris 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
Converterfor this context
-
converter
- Parameters:
converter- the newConverterto 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
MapEngineApiinstance
-
getDisplay()instead