Class NecrifyVelocityPlugin
- All Implemented Interfaces:
Necrify
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.velocitypowered.api.proxy.messages.ChannelIdentifierstatic final net.kyori.adventure.text.ComponentSince 1.19.1, cancelling chat messages on proxy is not possible anymore.Fields inherited from class de.jvstvshd.necrify.common.AbstractNecrifyPlugin
BUILD_NUMBER, configurationManager, executorService, GIT_COMMIT, VERSION -
Constructor Summary
ConstructorsConstructorDescriptionNecrifyVelocityPlugin(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger, Path dataDirectory) -
Method Summary
Modifier and TypeMethodDescription@NotNull MessagingChannelCommunicatorcreateKick(net.kyori.adventure.text.Component reason, NecrifyUser user, UUID punishmentUuid) createUser(com.velocitypowered.api.command.CommandSource source) createUser(UUID userId, boolean loadPunishmentsDirectly) Creates a user with the given UUID.com.velocitypowered.api.command.CommandSourcegetCommandSource(NecrifyUser user) com.zaxxer.hikari.HikariDataSource@NotNull EventDispatcherReturns the system's event dispatcher.@NotNull MessageProviderReturns the message provider used by this system.<T extends Punishment>
CompletableFuture<Optional<T>> getPunishment(@NotNull UUID punishmentId) Retrieves a punishment by its id.com.velocitypowered.api.proxy.ProxyServer@NotNull NecrifyUser@NotNull UserManagerReturns the user manager used by this system.booleanvoidonProxyInitialization(com.velocitypowered.api.event.proxy.ProxyInitializeEvent event) voidsetEventDispatcher(@NotNull EventDispatcher eventDispatcher) Sets the event dispatcher.voidsetMessageProvider(@NotNull MessageProvider messageProvider) Sets the message provider used by this system.voidsetPlayerResolver(PlayerResolver playerResolver) voidsetPunishmentManager(PunishmentManager punishmentManager) voidsetUserManager(@NotNull UserManager userManager) Sets the user manager used by this system.Methods inherited from class de.jvstvshd.necrify.common.AbstractNecrifyPlugin
buildInfo, getCachedPunishment, getConfig, getDefaultReason, getExecutor, getHistoricalPunishment, getHistoricalPunishmentCache, getLogger, getService, getTemplateManager, loadConfig, registerCommands, registerFactories, setTemplateManager
-
Field Details
-
MUTE_DATA_CHANNEL_IDENTIFIER
public static final com.velocitypowered.api.proxy.messages.ChannelIdentifier MUTE_DATA_CHANNEL_IDENTIFIER -
MUTES_DISABLED
public static final net.kyori.adventure.text.Component MUTES_DISABLEDSince 1.19.1, cancelling chat messages on proxy is not possible anymore. Therefore, we have to listen to the chat event on the actual game server. This means that there has to be a spigot/paper extension to this plugin which is not yet available unless there's a possibility. Therefore all mute related features are disabled for now. If you use 1.19 or lower you will not be affected by this.The progress of the extension can be found here. For this reason, every mute related feature is deprecated and marked as for removal until this extension is available.
-
-
Constructor Details
-
NecrifyVelocityPlugin
@Inject public NecrifyVelocityPlugin(com.velocitypowered.api.proxy.ProxyServer server, org.slf4j.Logger logger, Path dataDirectory)
-
-
Method Details
-
onProxyInitialization
public void onProxyInitialization(com.velocitypowered.api.event.proxy.ProxyInitializeEvent event) -
getPunishmentManager
-
setPunishmentManager
-
getPlayerResolver
-
setPlayerResolver
-
getServer
public com.velocitypowered.api.proxy.ProxyServer getServer() -
getDataSource
public com.zaxxer.hikari.HikariDataSource getDataSource() -
getMessageProvider
Description copied from interface:NecrifyReturns the message provider used by this system. A message provider provides localized messages for users based on a key and optional arguments.- Returns:
- the message provider.
-
communicator
-
setMessageProvider
Description copied from interface:NecrifySets the message provider used by this system. A message provider provides localized messages for users based on a key and optional arguments.This may does not affect anything after the system has been initialized fully.
- Parameters:
messageProvider- the message provider to set.
-
isWhitelistActive
public boolean isWhitelistActive()- Specified by:
isWhitelistActivein classAbstractNecrifyPlugin
-
getUserManager
Description copied from interface:NecrifyReturns the user manager used by this system. The user manager is responsible for loading and saving users and keeping their data accurate and up-to-date.- Returns:
- the user manager.
-
setUserManager
Description copied from interface:NecrifySets the user manager used by this system. The user manager is responsible for loading and saving users and keeping their data accurate and up-to-date.This may does not affect anything after the system has been initialized fully.
- Parameters:
userManager- the user manager to set.
-
getPunishment
public <T extends Punishment> CompletableFuture<Optional<T>> getPunishment(@NotNull @NotNull UUID punishmentId) Description copied from interface:NecrifyRetrieves a punishment by its id. This will also completely load the user this punishment is affecting.As of 1.2.2, this method may return a punishment object that only contains historical data about it. Thus, this punishment cannot be manipulated any further. To check whether the punishment is historical, you may use
Punishment.isOngoing(). If it returns true, the punishment is still active and can be manipulated in any way. If it returns false, the punishment probably is historical and cannot be manipulated. You can still retrieve log entries of historical punishments. Historical punishments are not added to the user's list of active punishments.- Type Parameters:
T- the type of the punishment.- Parameters:
punishmentId- the id of the punishment.- Returns:
- a future containing the punishment or
Optional.empty()if not found.
-
createUser
-
createUser
Creates a user with the given UUID. If the user is already cached, the cached user is returned.Note: this user does not hold any valid data besides his uuid and maybe player instance (if online). After returning the value, the missing user data will be loaded, whereafter the
UserLoadedEventwill be fired.- Parameters:
userId- the UUID of the user to create.loadPunishmentsDirectly- whether to load the punishments directly or not. This influences if punishments are loaded asynchronously or not. If set to true, punishments will be loaded blocking.- Returns:
- the created user.
-
getCommandSource
-
getEventDispatcher
Description copied from interface:NecrifyReturns the system's event dispatcher. The event dispatcher is responsible for dispatching events to the corresponding listeners.- Returns:
- the event dispatcher.
-
setEventDispatcher
Description copied from interface:NecrifySets the event dispatcher. The event dispatcher is responsible for dispatching events to the corresponding listeners.This may does not affect anything after the system has been initialized fully.
- Parameters:
eventDispatcher- the event dispatcher to set.
-
createKick
public NecrifyKick createKick(net.kyori.adventure.text.Component reason, NecrifyUser user, UUID punishmentUuid) - Specified by:
createKickin classAbstractNecrifyPlugin
-
getOnlinePlayers
- Specified by:
getOnlinePlayersin classAbstractNecrifyPlugin
-
getSystemUser
- Specified by:
getSystemUserin classAbstractNecrifyPlugin
-