diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-08-27 19:47:47 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-08-27 19:47:47 +0800 |
| commit | 5bf10e476366e9aff291d55c050a324734bae911 (patch) | |
| tree | b056d52c273c55d6e4e6d86da3abd971e6cdbf1e /RoughlyEnoughItems-api/src/main/java | |
| parent | 6104964f60bac00a4ac1359bd244d361e50786bd (diff) | |
| download | RoughlyEnoughItems-5bf10e476366e9aff291d55c050a324734bae911.tar.gz RoughlyEnoughItems-5bf10e476366e9aff291d55c050a324734bae911.tar.bz2 RoughlyEnoughItems-5bf10e476366e9aff291d55c050a324734bae911.zip | |
Some Nullable and NotNull annotations
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'RoughlyEnoughItems-api/src/main/java')
3 files changed, 18 insertions, 0 deletions
diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java index f6df5ab92..126358513 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/REIHelper.java @@ -32,6 +32,7 @@ import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; @@ -59,11 +60,15 @@ public interface REIHelper { boolean isDarkThemeEnabled(); + @Nullable TextFieldWidget getSearchTextField(); + @NotNull + @ApiStatus.Internal List<ItemStack> getInventoryStacks(); void queueTooltip(@Nullable Tooltip tooltip); + @NotNull ResourceLocation getDefaultDisplayTexture(); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java index 4136f3aa9..87e243e85 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeCategory.java @@ -32,6 +32,7 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; import java.util.Collections; import java.util.List; @@ -44,6 +45,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { * * @return the unique identifier of the category */ + @NotNull ResourceLocation getIdentifier(); /** @@ -51,6 +53,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { * * @return the renderer of the icon */ + @NotNull default EntryStack getLogo() { return EntryStack.empty(); } @@ -60,6 +63,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { * * @return the name */ + @NotNull String getCategoryName(); /** @@ -69,6 +73,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { * @return the recipe renderer */ @ApiStatus.OverrideOnly + @NotNull default RecipeEntry getSimpleRenderer(T recipe) { return SimpleRecipeEntry.from(recipe::getInputEntries, recipe::getResultingEntries); } @@ -81,6 +86,7 @@ public interface RecipeCategory<T extends RecipeDisplay> { * @return the list of widgets */ @ApiStatus.OverrideOnly + @NotNull default List<Widget> setupDisplay(T recipeDisplay, Rectangle bounds) { return Collections.singletonList(Widgets.createCategoryBase(bounds)); } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java index a22dea125..44e655da4 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/RecipeDisplay.java @@ -26,6 +26,7 @@ package me.shedaniel.rei.api; import me.shedaniel.rei.utils.CollectionUtils; import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; import java.util.Collections; import java.util.List; @@ -36,6 +37,7 @@ public interface RecipeDisplay { /** * @return a list of inputs */ + @NotNull List<List<EntryStack>> getInputEntries(); /** @@ -43,6 +45,7 @@ public interface RecipeDisplay { */ @Deprecated @ApiStatus.ScheduledForRemoval + @NotNull default List<EntryStack> getOutputEntries() { return Collections.emptyList(); } @@ -50,6 +53,7 @@ public interface RecipeDisplay { /** * @return a list of outputs */ + @NotNull default List<List<EntryStack>> getResultingEntries() { return CollectionUtils.map(getOutputEntries(), Collections::singletonList); } @@ -59,6 +63,7 @@ public interface RecipeDisplay { * * @return the list of required items */ + @NotNull default List<List<EntryStack>> getRequiredEntries() { return Collections.emptyList(); } @@ -68,6 +73,7 @@ public interface RecipeDisplay { * * @return the identifier of the category */ + @NotNull ResourceLocation getRecipeCategory(); /** @@ -75,6 +81,7 @@ public interface RecipeDisplay { * * @return the recipe location */ + @NotNull default Optional<ResourceLocation> getRecipeLocation() { return Optional.empty(); } |
