Package net.pinger.disguise.packet
Interface PacketContext
public interface PacketContext
-
Method Summary
Modifier and TypeMethodDescriptionThis method is used to assign a value to thePacketProviderfield which manages sent packets for disguisedThis method returns the current provider.Set<Class<? extends PacketProvider>>Returns aSetof registered providers.voidregisterProvider(Class<? extends PacketProvider> providerClass)This method registers the given provider.voidregisterProvider(Class<? extends PacketProvider> providerClass, boolean replace)This method registers the given provider, which will be instantiated once theapplyProvider()is called if the versions match.
-
Method Details
-
applyProvider
PacketProvider applyProvider()This method is used to assign a value to thePacketProviderfield which manages sent packets for disguised -
registerProvider
This method registers the given provider, which will be instantiated once theapplyProvider()is called if the versions match.If the replace boolean is true, this version will replace any other class that matches the provided version of this one. By default, the value is true.
- Parameters:
providerClass- the class of the providerreplace- whether we should replace any other classes with this noe- Throws:
IllegalArgumentException- if the class doesn't have aPacketHandlerannotation
-
registerProvider
This method registers the given provider.- Parameters:
providerClass- the given provider- Throws:
IllegalArgumentException- if the class doesn't have aPacketHandlerannotation
-
getProvider
PacketProvider getProvider()This method returns the current provider.- Returns:
- the provider
-
getRegisteredProviders
Set<Class<? extends PacketProvider>> getRegisteredProviders()Returns aSetof registered providers.- Returns:
- set of registered providers
-