Skip to content

Commit ac2496b

Browse files
committed
Updated plugin documentation
1 parent 4cb4404 commit ac2496b

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

README.MD

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ If the domain of a server contains an underscore you currently can't connect to
3434
## How to make a ViaProxy plugin
3535
### viaproxy.yml
3636
ViaProxy plugins require a ``viaproxy.yml`` file in the root of the plugin jar.\
37-
It defines the name, version, author and main class of the plugin:
37+
It defines the name, version, author, main class and minimum supported ViaProxy version of the plugin:
3838
````yaml
3939
name: "CoolPlugin"
4040
version: "1.0.0"
4141
author: "ExampleDude"
4242
main: "com.exampledude.coolplugin.Main"
43+
min-version: "3.0.0"
4344
````
4445

4546
### Plugin Main
@@ -52,6 +53,16 @@ public class Main extends ViaProxyPlugin {
5253
}
5354
````
5455

56+
There is an optional ``registerTransformers`` method that can be implemented to register class transformers **for the own plugin classes**:
57+
````java
58+
@Override
59+
public void registerTransformers(final TransformerManager transformerManager) {
60+
transformerManager.addTransformer("com.exampledude.coolplugin.Transformer");
61+
}
62+
````
63+
64+
Check out the [ClassTransform](https://github.com/Lenni0451/ClassTransform/#usage) documentation for more information on how to use class transformers.
65+
5566
### Events
5667
The only real way to interact with ViaProxy is through events.\
5768
ViaProxy uses [LambdaEvents](https://github.com/Lenni0451/LambdaEvents) for event handling.\
@@ -60,9 +71,11 @@ You can register a listener using the ``register()`` method in the ``PluginManag
6071
PluginManager.EVENT_MANAGER.register(this);
6172
````
6273

63-
ViaProxy currently has 15 events:
74+
ViaProxy currently (at the time of writing) has the following events:
6475
- Client2ProxyChannelInitializeEvent
6576
- Client2ProxyHandlerCreationEvent
77+
- ClientLoggedInEvent
78+
- ConnectEvent
6679
- ConsoleCommandEvent
6780
- FillPlayerDataEvent
6881
- GetDefaultPortEvent
@@ -77,8 +90,7 @@ ViaProxy currently has 15 events:
7790
- ResolveSrvEvent
7891
- ViaLoadingEvent
7992

80-
The events ``Client2ProxyChannelInitializeEvent`` and ``Proxy2ServerChannelInitializeEvent`` both have ``PRE`` and ``POST`` states.\
81-
Some events can be cancelled using the ``setCancelled()`` method.
93+
Some events have pre- and post-states and some events are cancellable.
8294

8395
To listen to an event you have to add the ``@EventHandler`` annotation to the handler method and put the event as the only parameter:
8496
````java

0 commit comments

Comments
 (0)