diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-12-11 20:24:47 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-12-11 20:24:47 +0800 |
| commit | 90b8a8181eb7e642fb88832f8bd8baa3acdcf804 (patch) | |
| tree | 85774b5a26be6a8303f99c5316aee320a737ffc8 | |
| parent | 14edd7e3f9e3716ff60e9d918760049c1313a485 (diff) | |
| download | RoughlyEnoughItems-90b8a8181eb7e642fb88832f8bd8baa3acdcf804.tar.gz RoughlyEnoughItems-90b8a8181eb7e642fb88832f8bd8baa3acdcf804.tar.bz2 RoughlyEnoughItems-90b8a8181eb7e642fb88832f8bd8baa3acdcf804.zip | |
Remove deprecated classes
Signed-off-by: shedaniel <daniel@shedaniel.me>
44 files changed, 41 insertions, 1763 deletions
diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java index f6b9232e7..743538410 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java @@ -59,17 +59,6 @@ public interface AutoTransferHandler { } /** - * Creates a successful result, no further handlers will be called. - * Will return to the previous screen rather than staying open. - * - * @deprecated use {@link #blocksFurtherHandling(boolean)} - */ - @Deprecated - static Result createSuccessfulReturningToScreen() { - return createSuccessful().blocksFurtherHandling(true); - } - - /** * Creates a passing result, further handlers will be called. * This will also mark the handler as not applicable. */ @@ -185,23 +174,9 @@ public interface AutoTransferHandler { @Nullable AbstractContainerScreen<?> getContainerScreen(); - - @Nullable - @Deprecated - @ApiStatus.ScheduledForRemoval - default AbstractContainerScreen<?> getHandledScreen() { - return getContainerScreen(); - } RecipeDisplay getRecipe(); - - @Nullable - @Deprecated - @ApiStatus.ScheduledForRemoval - default AbstractContainerMenu getScreenHandler() { - return getContainer(); - } - + @Nullable default AbstractContainerMenu getContainer() { return getContainerScreen() == null ? null : getContainerScreen().getMenu(); diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java index 797e44ecb..ddb17e63f 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ClientHelper.java @@ -37,7 +37,6 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -71,22 +70,6 @@ public interface ClientHelper { */ void setCheating(boolean cheating); - @Deprecated - @ApiStatus.ScheduledForRemoval - List<ItemStack> getInventoryItemsTypes(); - - /** - * Opens a recipe viewing screen: - * Opens {@link me.shedaniel.rei.gui.PreRecipeViewingScreen} if not set - * Opens {@link me.shedaniel.rei.gui.RecipeViewingScreen} if set to default - * Opens {@link me.shedaniel.rei.gui.VillagerRecipeViewingScreen} if set to villager - * - * @param map the map of recipes - */ - @ApiStatus.ScheduledForRemoval - @Deprecated - void openRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map); - /** * Tries to cheat stack using either packets or commands. * @@ -100,42 +83,6 @@ public interface ClientHelper { } /** - * Finds recipe for the stack and opens the recipe screen. - * - * @param stack the stack to find recipe for - * @return whether the stack has any recipes to show - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean executeRecipeKeyBind(EntryStack stack) { - return openView(ViewSearchBuilder.builder().addRecipesFor(stack).setOutputNotice(stack).fillPreferredOpenedCategory()); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean executeRecipeKeyBind(ItemStack stack) { - return executeRecipeKeyBind(EntryStack.create(stack)); - } - - /** - * Finds usage for the stack and opens the recipe screen. - * - * @param stack the stack to find usage for - * @return whether the stack has any usages to show - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean executeUsageKeyBind(EntryStack stack) { - return openView(ViewSearchBuilder.builder().addUsagesFor(stack).setInputNotice(stack).fillPreferredOpenedCategory()); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean executeUsageKeyBind(ItemStack stack) { - return executeUsageKeyBind(EntryStack.create(stack)); - } - - /** * Gets the mod from an item * * @param item the item to find @@ -219,33 +166,10 @@ public interface ClientHelper { /** * Gets the mod from a modid * - * @param modid the modid of the mod + * @param modId the modid of the mod * @return the mod name */ - String getModFromModId(String modid); - - /** - * Finds all recipes and open them in a recipe screen. - * - * @return whether there are any recipes to show - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean executeViewAllRecipesKeyBind() { - return openView(ViewSearchBuilder.builder().addAllCategories().fillPreferredOpenedCategory()); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean executeViewAllRecipesFromCategory(ResourceLocation category) { - return openView(ViewSearchBuilder.builder().addCategory(category).fillPreferredOpenedCategory()); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean executeViewAllRecipesFromCategories(List<ResourceLocation> categories) { - return openView(ViewSearchBuilder.builder().addCategories(categories).fillPreferredOpenedCategory()); - } + String getModFromModId(String modId); boolean openView(ViewSearchBuilder builder); diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigObject.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigObject.java index 8bce78e5b..d193b1bc4 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigObject.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/ConfigObject.java @@ -30,7 +30,6 @@ import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import org.jetbrains.annotations.ApiStatus; -import java.util.Collections; import java.util.List; @Environment(EnvType.CLIENT) @@ -63,10 +62,6 @@ public interface ConfigObject { boolean isToastDisplayedOnCopyIdentifier(); - @Deprecated - @ApiStatus.ScheduledForRemoval - boolean doesRenderEntryEnchantmentGlint(); - boolean isEntryListWidgetScrolled(); boolean shouldAppendModNames(); @@ -75,10 +70,6 @@ public interface ConfigObject { void setRecipeScreenType(RecipeScreenType recipeScreenType); - @Deprecated - @ApiStatus.ScheduledForRemoval - boolean isLoadingDefaultPlugin(); - SearchFieldLocation getSearchFieldLocation(); default boolean isLeftHandSidePanel() { @@ -117,22 +108,10 @@ public interface ConfigObject { boolean doDisplayFavoritesTooltip(); - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean doDisplayFavoritesOnTheLeft() { - return true; - } - boolean doesFastEntryRendering(); boolean doDebugRenderTimeRequired(); - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean doSearchFavorites() { - return false; - } - ModifierKeyCode getFavoriteKeyCode(); ModifierKeyCode getRecipeKeybind(); @@ -157,12 +136,6 @@ public interface ConfigObject { boolean isLowerConfigButton(); - @Deprecated - @ApiStatus.ScheduledForRemoval - default List<EntryStack> getFavorites() { - return Collections.emptyList(); - } - @ApiStatus.Experimental List<FavoriteEntry> getFavoriteEntries(); @@ -181,10 +154,6 @@ public interface ConfigObject { boolean isInventoryHighlightingAllowed(); - @Deprecated - @ApiStatus.ScheduledForRemoval - boolean shouldResizeDynamically(); - @ApiStatus.Experimental double getHorizontalEntriesBoundaries(); diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index cdafd0ba2..d63896203 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -25,16 +25,13 @@ package me.shedaniel.rei.api; import me.shedaniel.math.Rectangle; import me.shedaniel.rei.gui.config.DisplayPanelLocation; -import me.shedaniel.rei.gui.config.SearchFieldLocation; import me.shedaniel.rei.impl.Internals; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.world.InteractionResult; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.function.Supplier; @Environment(EnvType.CLIENT) public interface DisplayHelper { @@ -47,17 +44,6 @@ public interface DisplayHelper { return Internals.getDisplayHelper(); } - /** - * Gets the sorted version of all responsible bounds handlers - * - * @param screenClass the class for checking responsible bounds handlers - * @return the sorted list of responsible bounds handlers - * @see DisplayHelper#getResponsibleBoundsHandler(Class) for the unsorted version - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - List<DisplayBoundsHandler<?>> getSortedBoundsHandlers(Class<?> screenClass); - List<OverlayDecider> getSortedOverlayDeciders(Class<?> screenClass); /** @@ -68,17 +54,6 @@ public interface DisplayHelper { List<OverlayDecider> getAllOverlayDeciders(); /** - * Gets the responsible bounds handlers - * - * @param screenClass the class for checking responsible bounds handlers - * @return the the list of responsible bounds handlers - * @see DisplayHelper#getSortedBoundsHandlers(Class) for the sorted version - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - DisplayBoundsHandler<?> getResponsibleBoundsHandler(Class<?> screenClass); - - /** * Registers a bounds decider * * @param decider the decider to register @@ -122,105 +97,4 @@ public interface DisplayHelper { return getBaseSupportedClass().isAssignableFrom(screen); } } - - @Deprecated - @ApiStatus.ScheduledForRemoval - interface DisplayBoundsHandler<T> extends OverlayDecider { - /** - * Gets the base supported class for the bounds handler - * - * @return the base class - */ - Class<?> getBaseSupportedClass(); - - @Override - default boolean isHandingScreen(Class<?> screen) { - return getBaseSupportedClass().isAssignableFrom(screen); - } - - /** - * Gets the left bounds of the overlay - * - * @param screen the current screen - * @return the left bounds - */ - Rectangle getLeftBounds(T screen); - - /** - * Gets the right bounds of the overlay - * - * @param screen the current screen - * @return the right bounds - */ - Rectangle getRightBounds(T screen); - - /** - * Checks if item slot can fit the screen - * - * @param left the left x coordinates of the stack - * @param top the top y coordinates for the stack - * @param screen the current screen - * @param fullBounds the current bounds - * @return whether the item slot can fit - * @see BaseBoundsHandler#registerExclusionZones(Class, Supplier) for easier api - */ - default InteractionResult canItemSlotWidgetFit(int left, int top, T screen, Rectangle fullBounds) { - InteractionResult fit; - fit = isInZone(left, top); - if (fit != InteractionResult.PASS) - return fit; - fit = isInZone(left + 18, top); - if (fit != InteractionResult.PASS) - return fit; - fit = isInZone(left, top + 18); - if (fit != InteractionResult.PASS) - return fit; - fit = isInZone(left + 18, top + 18); - return fit; - } - - @Override - default InteractionResult isInZone(double mouseX, double mouseY) { - return OverlayDecider.super.isInZone(mouseX, mouseY); - } - - /** - * Gets the item list bounds by the overlay bounds - * - * @param rectangle the overlay bounds - * @return the item list bounds - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default Rectangle getItemListArea(Rectangle rectangle) { - return new Rectangle(rectangle.x + 1, rectangle.y + 2 + (ConfigObject.getInstance().getSearchFieldLocation() == SearchFieldLocation.TOP_SIDE ? 24 : 0) + (ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22), rectangle.width - 2, rectangle.height - (ConfigObject.getInstance().getSearchFieldLocation() != SearchFieldLocation.CENTER ? 27 + 22 : 27) + (!ConfigObject.getInstance().isEntryListWidgetScrolled() ? 0 : 22)); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default Rectangle getFavoritesListArea(Rectangle rectangle) { - int offset = 31 + (ConfigObject.getInstance().doesShowUtilsButtons() ? 25 : 0); - return new Rectangle(rectangle.x + 1, rectangle.y + 2 + offset, rectangle.width - 2, rectangle.height - 5 - offset); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default boolean shouldRecalculateArea(boolean isOnRightSide, Rectangle rectangle) { - return false; - } - - @Override - default boolean shouldRecalculateArea(DisplayPanelLocation location, Rectangle rectangle) { - return shouldRecalculateArea(location == DisplayPanelLocation.RIGHT, rectangle); - } - - /** - * Gets the priority of the handler, the higher it is, the earlier it is called. - * - * @return the priority in float - */ - @Override - float getPriority(); - } - } diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java index 7d32ccf40..369862794 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryRegistry.java @@ -36,7 +36,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.function.Predicate; -import java.util.stream.Collectors; import java.util.stream.Stream; @Environment(EnvType.CLIENT) @@ -50,18 +49,6 @@ public interface EntryRegistry { return Internals.getEntryRegistry(); } - /** - * Gets the current modifiable stacks list - * - * @return a stacks list - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - @NotNull - default List<EntryStack> getStacksList() { - return getEntryStacks().collect(Collectors.toList()); - } - @NotNull Stream<EntryStack> getEntryStacks(); @@ -96,26 +83,6 @@ public interface EntryRegistry { void registerEntryAfter(@Nullable EntryStack afterEntry, @NotNull EntryStack stack); /** - * Registers an new stack to the entry list - * - * @param afterEntry the stack to put after - * @param stack the stack to register - * @param checkAlreadyContains whether the list should check if it is already on the list - * @see #queueRegisterEntryAfter(EntryStack, Collection) for a faster method - */ - @Deprecated - @ApiStatus.ScheduledForRemoval - default void registerEntryAfter(@Nullable EntryStack afterEntry, @NotNull EntryStack stack, boolean checkAlreadyContains) { - registerEntryAfter(afterEntry, stack); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - default void queueRegisterEntryAfter(@Nullable EntryStack afterEntry, @NotNull Collection<@NotNull ? extends EntryStack> stacks) { - registerEntriesAfter(afterEntry, stacks); - } - - /** * Registers multiple stacks to the item list * * @param afterStack the stack to put after diff --git a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java index 70c8a06bc..fb117d3b8 100644 --- a/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java +++ b/RoughlyEnoughItems-api/src/main/java/me/shedaniel/rei/api/EntryStack.java @@ -146,24 +146,6 @@ public interface EntryStack extends TextRepresentable { return ImmutableList.copyOf(result); } - @Deprecated - @ApiStatus.ScheduledForRemoval - static List<EntryStack> create(Collection<ItemStack> stacks) { - return ofItemStacks(stacks); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - static List<EntryStack> create(Ingredient ingredient) { - return ofIngredient(ingredient); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - static List<List<EntryStack>> create(List<Ingredient> ingredients) { - return ofIngredients(ingredients); - } - @ApiStatus.Internal static EntryStack readFromJson(JsonElement jsonElement) { try { @@ -216,34 +198,6 @@ public interface EntryStack extends TextRepresentable { } } - @Deprecated - @ApiStatus.ScheduledForRemoval - static EntryStack copyFluidToBucket(EntryStack stack) { - return copyFluidToItem(stack); - } - - @Deprecated - @ApiStatus.ScheduledForRemoval - static EntryStack copyFluidToItem(EntryStack stack) { - Item bucketItem = stack.getFluid().getBucket(); - if (bucketItem != null) { - return EntryStack.create(bucketItem); - } - return EntryStack.empty(); - } - - @Deprecated - @ApiStatus.Schedu |
