aboutsummaryrefslogtreecommitdiff
path: root/api/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-11-21 19:15:42 +0800
committershedaniel <daniel@shedaniel.me>2021-11-21 19:15:42 +0800
commit78f17f19326d7789fa4c2ae9b9df3ac982002418 (patch)
tree0d54a245d82f1cce683a330b4999fb1db31d8b4b /api/src/main/java
parent85e72e9a9bc70cf283ba872172985b338be59233 (diff)
downloadRoughlyEnoughItems-78f17f19326d7789fa4c2ae9b9df3ac982002418.tar.gz
RoughlyEnoughItems-78f17f19326d7789fa4c2ae9b9df3ac982002418.tar.bz2
RoughlyEnoughItems-78f17f19326d7789fa4c2ae9b9df3ac982002418.zip
Fix compile errors
Diffstat (limited to 'api/src/main/java')
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/display/TransferDisplayCategory.java45
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandler.java28
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandlerErrorRenderer.java16
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/entry/EntryStack.java4
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryDefinition.java4
-rw-r--r--api/src/main/java/me/shedaniel/rei/api/common/transfer/info/MenuInfo.java14
6 files changed, 2 insertions, 109 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/TransferDisplayCategory.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/display/TransferDisplayCategory.java
deleted file mode 100644
index 00843f57a..000000000
--- a/api/src/main/java/me/shedaniel/rei/api/client/registry/display/TransferDisplayCategory.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * This file is licensed under the MIT License, part of Roughly Enough Items.
- * Copyright (c) 2018, 2019, 2020, 2021 shedaniel
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package me.shedaniel.rei.api.client.registry.display;
-
-import com.mojang.blaze3d.vertex.PoseStack;
-import it.unimi.dsi.fastutil.ints.IntList;
-import me.shedaniel.math.Rectangle;
-import me.shedaniel.rei.api.client.gui.widgets.Widget;
-import me.shedaniel.rei.api.common.display.Display;
-import net.fabricmc.api.EnvType;
-import net.fabricmc.api.Environment;
-import org.jetbrains.annotations.ApiStatus;
-
-import java.util.List;
-
-@Environment(EnvType.CLIENT)
-@Deprecated
-@ApiStatus.ScheduledForRemoval
-public interface TransferDisplayCategory<T extends Display> extends DisplayCategory<T> {
- @ApiStatus.OverrideOnly
- @ApiStatus.ScheduledForRemoval
- @Deprecated
- void renderRedSlots(PoseStack matrices, List<Widget> widgets, Rectangle bounds, T display, IntList redSlots);
-}
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandler.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandler.java
index 2d8a8ef83..c91804d7b 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandler.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandler.java
@@ -23,8 +23,6 @@
package me.shedaniel.rei.api.client.registry.transfer;
-import it.unimi.dsi.fastutil.ints.IntList;
-import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
import me.shedaniel.rei.api.common.display.Display;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
@@ -66,10 +64,6 @@ public interface TransferHandler extends Comparable<TransferHandler> {
@Environment(EnvType.CLIENT)
@Nullable
default TransferHandlerErrorRenderer provideErrorRenderer(Context context, Object data) {
- if (data instanceof IntList) {
- return TransferHandlerErrorRenderer.forRedSlots((IntList) data);
- }
-
return null;
}
@@ -111,28 +105,6 @@ public interface TransferHandler extends Comparable<TransferHandler> {
}
/**
- * Creates a passing result, further handlers will be called.
- *
- * @param error The error itself
- * @param redSlots A list of slots to be marked as red. Will be passed to {@link TransferDisplayCategory}.
- */
- static Result createFailed(Component error, IntList redSlots) {
- return createFailed(error).errorRenderer(redSlots);
- }
-
- /**
- * Creates a passing result, further handlers will be called.
- * The special color will be applied if this is the last handler.
- *
- * @param error The error itself
- * @param color A special color for the button
- * @param redSlots A list of slots to be marked as red. Will be passed to {@link TransferDisplayCategory}.
- */
- static Result createFailedCustomButtonColor(Component error, IntList redSlots, int color) {
- return createFailed(error).errorRenderer(redSlots).color(color);
- }
-
- /**
* Forces this handler to be the last handler, no further handlers will be called.
*/
default Result blocksFurtherHandling() {
diff --git a/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandlerErrorRenderer.java b/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandlerErrorRenderer.java
index d9669d753..ed5083dba 100644
--- a/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandlerErrorRenderer.java
+++ b/api/src/main/java/me/shedaniel/rei/api/client/registry/transfer/TransferHandlerErrorRenderer.java
@@ -24,31 +24,15 @@
package me.shedaniel.rei.api.client.registry.transfer;
import com.mojang.blaze3d.vertex.PoseStack;
-import it.unimi.dsi.fastutil.ints.IntList;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.widgets.Widget;
-import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
-import me.shedaniel.rei.api.client.registry.display.DisplayCategory;
-import me.shedaniel.rei.api.client.registry.display.TransferDisplayCategory;
import me.shedaniel.rei.api.common.display.Display;
import org.jetbrains.annotations.ApiStatus;
import java.util.List;
-import java.util.Objects;
@ApiStatus.Experimental
@FunctionalInterface
public interface TransferHandlerErrorRenderer {
void render(PoseStack matrices, int mouseX, int mouseY, float delta, List<Widget> widgets, Rectangle bounds, Display display);
-
- @ApiStatus.Internal
- static TransferHandlerErrorRenderer forRedSlots(IntList redSlots) {
- return (matrices, mouseX, mouseY, delta, widgets, bounds, display) -> {
- DisplayCategory<?> category = Objects.requireNonNull(CategoryRegistry.getInstance().get(display.getCategoryIdentifier()))
- .getCategory();
- if (category instanceof TransferDisplayCategory) {
- ((TransferDisplayCategory<Display>) category).renderRedSlots(matrices, widgets, bounds, display, redSlots);
- }
- };
- }
}
diff --git a/api/src/main/java/me/shedaniel/rei/api/common/entry/EntryStack.java b/api/src/main/java/me/shedaniel/rei/api/common/entry/EntryStack.java
index da37a0432..8c4eb908d 100644
--- a/api/src/main/java/me/shedaniel/rei/api/common/entry/EntryStack.java
+++ b/api/src/main/java/me/shedaniel/rei/api/common/entry/EntryStack.java
@@ -167,9 +167,7 @@ public interface EntryStack<T> extends TextRepresentable, Renderer {
* @return a copy for an entry
* @since 6.2
*/
- default EntryStack<T> wildcard() {
- return normalize();
- }
+ EntryStack<T> wildcard();
Collection<ResourceLocation> getTagsFor();
diff --git a/api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryDefinition.java b/api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryDefinition.java
index 343a3491c..9ac8607af 100644
--- a/api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryDefinition.java
+++ b/api/src/main/java/me/shedaniel/rei/api/common/entry/type/EntryDefinition.java
@@ -128,9 +128,7 @@ public interface EntryDefinition<T> {
* @return a wildcard copy for an entry
* @since 6.2
*/
- default T wildcard(EntryStack<T> entry, T value) {
- return normalize(entry, value);
- }
+ T wildcard(EntryStack<T> entry, T value);
long hash(EntryStack<T> entry, T value, ComparisonContext context);
diff --git a/api/src/main/java/me/shedaniel/rei/api/common/transfer/info/MenuInfo.java b/api/src/main/java/me/shedaniel/rei/api/common/transfer/info/MenuInfo.java
index 7fe0e15a4..76fddd600 100644
--- a/api/src/main/java/me/shedaniel/rei/api/common/transfer/info/MenuInfo.java
+++ b/api/src/main/java/me/shedaniel/rei/api/common/transfer/info/MenuInfo.java
@@ -28,7 +28,6 @@ import it.unimi.dsi.fastutil.ints.IntList;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.gui.widgets.Slot;
import me.shedaniel.rei.api.client.gui.widgets.Widget;
-import me.shedaniel.rei.api.common.category.CategoryIdentifier;
import me.shedaniel.rei.api.common.display.Display;
import me.shedaniel.rei.api.common.display.DisplaySerializerRegistry;
import me.shedaniel.rei.api.common.entry.EntryStack;
@@ -46,7 +45,6 @@ import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack;
-import org.jetbrains.annotations.ApiStatus;
import java.util.Collections;
import java.util.List;
@@ -132,18 +130,6 @@ public interface MenuInfo<T extends AbstractContainerMenu, D extends Display> {
}
/**
- * Returns the inputs of the {@link Display}. The nested lists are possible stacks for that specific slot.
- *
- * @param context the context of the transfer
- * @return the list of lists of items
- */
- @Deprecated
- @ApiStatus.ScheduledForRemoval
- default List<List<ItemStack>> getInputs(MenuInfoContext<T, ?, D> context) {
- return getInputs(context, false);
- }
-
- /**
* Serializes the {@link Display} as {@link CompoundTag}, sent to the server for further info for the transfer.
*
* @param context the context of the transfer