public abstract class GuiInstance extends Object
Interactions
of Players with a Layout and renders and sends
the corresponding frames.Modifier and Type | Class and Description |
---|---|
static class |
GuiInstance.GuiType |
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<org.bukkit.entity.Player,Interaction> |
interactions |
protected Map<org.bukkit.entity.Player,GuiPoint> |
lastCursorPosition |
protected Map<org.bukkit.entity.Player,String> |
lastState |
protected Layout |
layout |
protected org.bukkit.scheduler.BukkitTask |
renderTask |
static int |
sendCount |
protected boolean |
showCursor |
protected GuiInstance.GuiType |
type |
Constructor and Description |
---|
GuiInstance(Layout layout,
int[] mapIDs,
boolean showCursor,
GuiInstance.GuiType type)
Instantiates a new GuiInstance.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Dispose this instance.
|
void |
endInteraction(org.bukkit.entity.Player player)
Ends an interaction with this instance.
|
protected int |
generateMapID() |
abstract GuiPoint |
getCursor(org.bukkit.entity.Player player)
Gets the cursor of a player.
|
Interaction |
getInteraction(org.bukkit.entity.Player player)
Get a players interaction with this instance.
|
Layout |
getLayout()
Gets layout.
|
int[] |
getMapIDs()
Get the Minecraft Map IDs used by this GUI instance.
|
GuiInstance.GuiType |
getType()
Gets GUI type.
|
boolean |
isInteracting(org.bukkit.entity.Player player)
Check whether a play is currently interacting with this instance.
|
protected void |
sendRenderData(org.bukkit.entity.Player player,
byte[][] renderData,
byte[][] cachedRenderData,
GuiPoint cursorPosition,
boolean cursorPositionChanged) |
void |
setMapIdConverter(BiFunction<Integer,org.bukkit.entity.Player,Integer> mapIdConverter) |
protected void |
setMapIDs(int[] mapIDs) |
void |
startInteraction(org.bukkit.entity.Player player)
Start an interaction with this instance.
|
protected void |
startRendering() |
public static int sendCount
protected final Layout layout
protected final ConcurrentMap<org.bukkit.entity.Player,Interaction> interactions
protected org.bukkit.scheduler.BukkitTask renderTask
protected final boolean showCursor
protected GuiInstance.GuiType type
public GuiInstance(Layout layout, int[] mapIDs, boolean showCursor, GuiInstance.GuiType type)
layout
- the layoutmapIDs
- the map i dsshowCursor
- the show cursorpublic abstract GuiPoint getCursor(org.bukkit.entity.Player player)
player
- the playerpublic int[] getMapIDs()
protected void setMapIDs(int[] mapIDs)
public void setMapIdConverter(BiFunction<Integer,org.bukkit.entity.Player,Integer> mapIdConverter)
public Layout getLayout()
public GuiInstance.GuiType getType()
public void startInteraction(org.bukkit.entity.Player player)
GuiWallManager
or
GuiItemManager
.player
- the playerpublic void endInteraction(org.bukkit.entity.Player player)
GuiWallManager
or
GuiItemManager
.player
- the playerprotected void startRendering()
protected void sendRenderData(org.bukkit.entity.Player player, byte[][] renderData, byte[][] cachedRenderData, GuiPoint cursorPosition, boolean cursorPositionChanged)
protected int generateMapID()
public boolean isInteracting(org.bukkit.entity.Player player)
player
- the playerpublic Interaction getInteraction(org.bukkit.entity.Player player)
player
- the playerpublic void dispose()
Copyright © 2021. All rights reserved.