updated README

This commit is contained in:
FlorianMichael 2023-03-01 19:47:00 +01:00
parent d97c7c320c
commit 79dfbc6b3b

View File

@ -69,38 +69,18 @@ To load the addon you have to specify the addon main class as entrypoint in your
### General API
In case you need an event as soon as the idle packet is skipped in the <= 1.8, you can do that: <br>
```java
public class Example {
static {
IdlePacketExecutor.registerIdlePacketSkipExecute(() -> {
// Called when the idle packet is skipped
});
}
}
IdlePacketExecutor.registerIdlePacketSkipExecute(() -> {
// Called when the idle packet is skipped
});
```
In case you need the release version of a material, you can do that:
```java
public class Example {
static {
final ProtocolRange range = ItemReleaseVersionDefinition.getItemMap().get(Items.WRITABLE_BOOK); // If an item does not appear in the item map, it has always existed
final ProtocolRange range = ItemReleaseVersionDefinition.getItemMap().get(Items.WRITABLE_BOOK); // If an item does not appear in the item map, it has always existed
// The Range class then contains all versions in which the item occurs.
// You can find out how the Range class works in the ViaLoadingBase README.
// https://github.com/FlorianMichael/ViaLoadingBase
}
}
```
To get the current Maximum Chat Length you can do this:
```java
public class Example {
static {
final int maxLength = ChatLengthDefinition.getMaxLength();
}
}
// The Range class then contains all versions in which the item occurs.
// You can find out how the Range class works in the ViaLoadingBase README.
// https://github.com/FlorianMichael/ViaLoadingBase
```
To create a setting group, you can simply use the SettingGroup class: