Class ServerResourcePackSendEvent
- java.lang.Object
-
- com.velocitypowered.api.event.player.ServerResourcePackSendEvent
-
- All Implemented Interfaces:
ResultedEvent<ResultedEvent.GenericResult>
@AwaitingEvent public class ServerResourcePackSendEvent extends Object implements ResultedEvent<ResultedEvent.GenericResult>
This event is fired when the downstream server tries to send a player a ResourcePack packet. The proxy will wait on this event to finish before forwarding the resource pack to the user. If this event is denied, it will retroactively send a DENIED status to the downstream server in response. If the downstream server has it set to "forced" it will forcefully disconnect the user.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description ServerResourcePackSendEvent(ResourcePackInfo receivedResourcePack, ServerConnection serverConnection)Constructs a new ServerResourcePackSendEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourcePackInfogetProvidedResourcePack()ResourcePackInfogetReceivedResourcePack()ResultedEvent.GenericResultgetResult()Returns the result associated with this event.ServerConnectiongetServerConnection()voidsetProvidedResourcePack(ResourcePackInfo providedResourcePack)voidsetResult(ResultedEvent.GenericResult result)Sets the result of this event.
-
-
-
Constructor Detail
-
ServerResourcePackSendEvent
public ServerResourcePackSendEvent(ResourcePackInfo receivedResourcePack, ServerConnection serverConnection)
Constructs a new ServerResourcePackSendEvent.- Parameters:
receivedResourcePack- The resource pack the server sent.serverConnection- The connection this occurred on.
-
-
Method Detail
-
getServerConnection
public ServerConnection getServerConnection()
-
getReceivedResourcePack
public ResourcePackInfo getReceivedResourcePack()
-
getProvidedResourcePack
public ResourcePackInfo getProvidedResourcePack()
-
setProvidedResourcePack
public void setProvidedResourcePack(ResourcePackInfo providedResourcePack)
-
getResult
public ResultedEvent.GenericResult getResult()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<ResultedEvent.GenericResult>- Returns:
- the result of this event
-
setResult
public void setResult(ResultedEvent.GenericResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<ResultedEvent.GenericResult>- Parameters:
result- the new result
-
-