Class VGuiServiceImpl
java.lang.Object
me.agent.vgui.core.internal.VGuiServiceImpl
- All Implemented Interfaces:
VGuiService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(VGuiListener listener) Registers a global listener observing all views.booleanback(com.velocitypowered.api.proxy.Player player) Returns to the player's previous view, if any.voidclose(com.velocitypowered.api.proxy.Player player) Closes the player's current view (firesCloseReason.SERVER).voidcloseAll()Closes every open view on the proxy.currentContents(com.velocitypowered.api.proxy.Player player) The live contents of the player's open view, ornull.currentContext(com.velocitypowered.api.proxy.Player player) The player's current view context, ornull.currentView(com.velocitypowered.api.proxy.Player player) The player's open view, ornull.booleanisViewing(com.velocitypowered.api.proxy.Player player) Whether the player has a proxy view open.voidOpens a view.voidopen(com.velocitypowered.api.proxy.Player player, View view, Consumer<ViewContext> contextBuilder) Opens a view, configuring a fresh context first.voidopen(com.velocitypowered.api.proxy.Player player, View view, ViewContext context) Opens a view with a pre-populated context.voidopenReplacing(com.velocitypowered.api.proxy.Player player, View view) Opens a view without pushing the currently open view onto the back-history.voidopenReplacing(com.velocitypowered.api.proxy.Player player, View view, ViewContext context) Opens a view without pushing history, with a pre-populated context.prompt(com.velocitypowered.api.proxy.Player player, net.kyori.adventure.text.Component title) Opens an anvil text prompt.prompt(com.velocitypowered.api.proxy.Player player, net.kyori.adventure.text.Component title, String initialText) Opens an anvil text prompt with pre-filled initial text.voidremoveListener(VGuiListener listener) Removes a previously registered global listener.
-
Constructor Details
-
VGuiServiceImpl
-
-
Method Details
-
open
Description copied from interface:VGuiServiceOpens a view. If another proxy view is open it is pushed onto the player's back-history (seeVGuiService.back(Player)).- Specified by:
openin interfaceVGuiService
-
open
Description copied from interface:VGuiServiceOpens a view with a pre-populated context.- Specified by:
openin interfaceVGuiService
-
open
public void open(com.velocitypowered.api.proxy.Player player, View view, Consumer<ViewContext> contextBuilder) Description copied from interface:VGuiServiceOpens a view, configuring a fresh context first.- Specified by:
openin interfaceVGuiService
-
openReplacing
Description copied from interface:VGuiServiceOpens a view without pushing the currently open view onto the back-history.- Specified by:
openReplacingin interfaceVGuiService
-
openReplacing
public void openReplacing(com.velocitypowered.api.proxy.Player player, View view, ViewContext context) Description copied from interface:VGuiServiceOpens a view without pushing history, with a pre-populated context.- Specified by:
openReplacingin interfaceVGuiService
-
back
public boolean back(com.velocitypowered.api.proxy.Player player) Description copied from interface:VGuiServiceReturns to the player's previous view, if any.- Specified by:
backin interfaceVGuiService- Returns:
trueif a previous view was reopened
-
close
public void close(com.velocitypowered.api.proxy.Player player) Description copied from interface:VGuiServiceCloses the player's current view (firesCloseReason.SERVER).- Specified by:
closein interfaceVGuiService
-
closeAll
public void closeAll()Description copied from interface:VGuiServiceCloses every open view on the proxy.- Specified by:
closeAllin interfaceVGuiService
-
currentView
Description copied from interface:VGuiServiceThe player's open view, ornull.- Specified by:
currentViewin interfaceVGuiService
-
currentContext
Description copied from interface:VGuiServiceThe player's current view context, ornull.- Specified by:
currentContextin interfaceVGuiService
-
currentContents
Description copied from interface:VGuiServiceThe live contents of the player's open view, ornull.- Specified by:
currentContentsin interfaceVGuiService
-
isViewing
public boolean isViewing(com.velocitypowered.api.proxy.Player player) Description copied from interface:VGuiServiceWhether the player has a proxy view open.- Specified by:
isViewingin interfaceVGuiService
-
prompt
public CompletableFuture<String> prompt(com.velocitypowered.api.proxy.Player player, net.kyori.adventure.text.Component title) Description copied from interface:VGuiServiceOpens an anvil text prompt. The future completes with the entered text when the player confirms, or withnullif the prompt closes, is replaced, or cannot be opened.- Specified by:
promptin interfaceVGuiService
-
prompt
public CompletableFuture<String> prompt(com.velocitypowered.api.proxy.Player player, net.kyori.adventure.text.Component title, String initialText) Description copied from interface:VGuiServiceOpens an anvil text prompt with pre-filled initial text.- Specified by:
promptin interfaceVGuiService
-
addListener
Description copied from interface:VGuiServiceRegisters a global listener observing all views.- Specified by:
addListenerin interfaceVGuiService
-
removeListener
Description copied from interface:VGuiServiceRemoves a previously registered global listener.- Specified by:
removeListenerin interfaceVGuiService
-