3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Make ItemRewriter type getters nullable and optional (#3737)

Dieser Commit ist enthalten in:
EnZaXD 2024-03-05 23:23:57 +01:00 committet von GitHub
Ursprung 2d03110f08
Commit 908823c612
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -45,11 +45,35 @@ public interface ItemRewriter<T extends Protocol> extends Rewriter<T> {
*/
@Nullable Item handleItemToServer(@Nullable Item item);
Type<Item> itemType();
/**
* Returns the item type of the current protocol.
* @return item type
*/
@Nullable default Type<Item> itemType() {
return null;
}
Type<Item[]> itemArrayType();
/**
* Returns the item array type of the current protocol.
* @return item array type
*/
@Nullable default Type<Item[]> itemArrayType() {
return null;
}
Type<Item> mappedItemType();
/**
* Returns the mapped item type of the target protocol.
* @return mapped item type
*/
@Nullable default Type<Item> mappedItemType() {
return itemType();
}
Type<Item[]> mappedItemArrayType();
/**
* Returns the mapped item array type of the target protocol.
* @return mapped item array type
*/
@Nullable default Type<Item[]> mappedItemArrayType() {
return itemArrayType();
}
}