mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-26 03:55:28 +01:00
Make ItemRewriter type getters nullable and optional (#3737)
This commit is contained in:
parent
2d03110f08
commit
908823c612
@ -45,11 +45,35 @@ public interface ItemRewriter<T extends Protocol> extends Rewriter<T> {
|
|||||||
*/
|
*/
|
||||||
@Nullable Item handleItemToServer(@Nullable Item item);
|
@Nullable Item handleItemToServer(@Nullable Item item);
|
||||||
|
|
||||||
Type<Item> itemType();
|
/**
|
||||||
|
* Returns the item type of the current protocol.
|
||||||
Type<Item[]> itemArrayType();
|
* @return item type
|
||||||
|
*/
|
||||||
Type<Item> mappedItemType();
|
@Nullable default Type<Item> itemType() {
|
||||||
|
return null;
|
||||||
Type<Item[]> mappedItemArrayType();
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the item array type of the current protocol.
|
||||||
|
* @return item array type
|
||||||
|
*/
|
||||||
|
@Nullable default Type<Item[]> itemArrayType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the mapped item type of the target protocol.
|
||||||
|
* @return mapped item type
|
||||||
|
*/
|
||||||
|
@Nullable default Type<Item> mappedItemType() {
|
||||||
|
return itemType();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the mapped item array type of the target protocol.
|
||||||
|
* @return mapped item array type
|
||||||
|
*/
|
||||||
|
@Nullable default Type<Item[]> mappedItemArrayType() {
|
||||||
|
return itemArrayType();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user