aboutsummaryrefslogtreecommitdiff
path: root/api/src/main/java/me/shedaniel/rei/impl
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2021-02-05 10:08:44 +0800
committershedaniel <daniel@shedaniel.me>2021-02-05 10:08:44 +0800
commitea634e7ba29146d4ebc2c05b61257fa6c3b0642e (patch)
treecd6caf4e9b77e13b21d1c890bf38604109fd93f2 /api/src/main/java/me/shedaniel/rei/impl
parentf5b59076cece9e95e76158b17b64fec27616b68b (diff)
downloadRoughlyEnoughItems-ea634e7ba29146d4ebc2c05b61257fa6c3b0642e.tar.gz
RoughlyEnoughItems-ea634e7ba29146d4ebc2c05b61257fa6c3b0642e.tar.bz2
RoughlyEnoughItems-ea634e7ba29146d4ebc2c05b61257fa6c3b0642e.zip
More relocation
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'api/src/main/java/me/shedaniel/rei/impl')
-rw-r--r--api/src/main/java/me/shedaniel/rei/impl/Internals.java19
-rw-r--r--api/src/main/java/me/shedaniel/rei/impl/RenderingEntry.java115
2 files changed, 11 insertions, 123 deletions
diff --git a/api/src/main/java/me/shedaniel/rei/impl/Internals.java b/api/src/main/java/me/shedaniel/rei/impl/Internals.java
index 33b0498ad..60550b100 100644
--- a/api/src/main/java/me/shedaniel/rei/impl/Internals.java
+++ b/api/src/main/java/me/shedaniel/rei/impl/Internals.java
@@ -27,13 +27,16 @@ import com.google.gson.JsonObject;
import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.*;
-import me.shedaniel.rei.api.entry.EntryDefinition;
-import me.shedaniel.rei.api.entry.EntryType;
-import me.shedaniel.rei.api.entry.EntryTypeRegistry;
import me.shedaniel.rei.api.favorites.FavoriteEntry;
import me.shedaniel.rei.api.favorites.FavoriteEntryType;
import me.shedaniel.rei.api.fluid.FluidSupportProvider;
+import me.shedaniel.rei.api.ingredient.EntryStack;
+import me.shedaniel.rei.api.ingredient.entry.EntryDefinition;
+import me.shedaniel.rei.api.ingredient.entry.EntryType;
+import me.shedaniel.rei.api.ingredient.entry.EntryTypeRegistry;
import me.shedaniel.rei.api.subsets.SubsetsRegistry;
+import me.shedaniel.rei.api.util.DrawableConsumer;
+import me.shedaniel.rei.api.util.Renderer;
import me.shedaniel.rei.api.widgets.*;
import me.shedaniel.rei.gui.widget.Widget;
import net.fabricmc.api.EnvType;
@@ -56,13 +59,13 @@ import java.util.function.Supplier;
public final class Internals {
private static Supplier<ConfigManager> configManager = Internals::throwNotSetup;
private static Supplier<ClientHelper> clientHelper = Internals::throwNotSetup;
- private static Supplier<RecipeHelper> recipeHelper = Internals::throwNotSetup;
+ private static Supplier<RecipeRegistry> recipeHelper = Internals::throwNotSetup;
private static Supplier<REIHelper> reiHelper = Internals::throwNotSetup;
private static Supplier<FluidSupportProvider> fluidSupportProvider = Internals::throwNotSetup;
private static Supplier<EntryStackProvider> entryStackProvider = Internals::throwNotSetup;
private static Supplier<SubsetsRegistry> subsetsRegistry = Internals::throwNotSetup;
private static Supplier<EntryRegistry> entryRegistry = Internals::throwNotSetup;
- private static Supplier<DisplayHelper> displayHelper = Internals::throwNotSetup;
+ private static Supplier<DisplayBoundsRegistry> displayHelper = Internals::throwNotSetup;
private static Supplier<WidgetsProvider> widgetsProvider = Internals::throwNotSetup;
private static Supplier<ClientHelper.ViewSearchBuilder> viewSearchBuilder = Internals::throwNotSetup;
private static Supplier<FavoriteEntryType.Registry> favoriteEntryTypeRegistry = Internals::throwNotSetup;
@@ -89,7 +92,7 @@ public final class Internals {
}
@NotNull
- public static RecipeHelper getRecipeHelper() {
+ public static RecipeRegistry getRecipeHelper() {
return recipeHelper.get();
}
@@ -120,7 +123,7 @@ public final class Internals {
}
@NotNull
- public static DisplayHelper getDisplayHelper() {
+ public static DisplayBoundsRegistry getDisplayHelper() {
return displayHelper.get();
}
@@ -197,7 +200,7 @@ public final class Internals {
EntryType<Unit> emptyType(ResourceLocation id);
- EntryType<Unit> renderingType(ResourceLocation id);
+ EntryType<Renderer> renderingType(ResourceLocation id);
}
@Environment(EnvType.CLIENT)
diff --git a/api/src/main/java/me/shedaniel/rei/impl/RenderingEntry.java b/api/src/main/java/me/shedaniel/rei/impl/RenderingEntry.java
deleted file mode 100644
index 9f5eaab5c..000000000
--- a/api/src/main/java/me/shedaniel/rei/impl/RenderingEntry.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * This file is licensed under the MIT License, part of Roughly Enough Items.
- * Copyright (c) 2018, 2019, 2020 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.impl;
-
-import me.shedaniel.architectury.utils.Fraction;
-import me.shedaniel.rei.api.EntryStack;
-import me.shedaniel.rei.api.entry.BuiltinEntryTypes;
-import me.shedaniel.rei.api.entry.ComparisonContext;
-import me.shedaniel.rei.api.entry.EntryDefinition;
-import net.minecraft.client.gui.GuiComponent;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.util.Unit;
-import org.jetbrains.annotations.ApiStatus;
-import org.jetbrains.annotations.NotNull;
-
-import java.util.Optional;
-
-@ApiStatus.OverrideOnly
-public abstract class RenderingEntry extends GuiComponent implements EntryStack<Unit> {
- @Override
- public @NotNull EntryDefinition<Unit> getDefinition() {
- return BuiltinEntryTypes.RENDERING.getDefinition();
- }
-
- @Override
- public Optional<ResourceLocation> getIdentifier() {
- return Optional.empty();
- }
-
- @Override
- public Fraction getAmount() {
- return Fraction.zero();
- }
-
- @Override
- public void setAmount(Fraction amount) {
-
- }
-
- @Override
- public boolean isEmpty() {
- return false;
- }
-
- @Override
- public EntryStack<Unit> copy() {
- return this;
- }
-
- @Override
- public Unit getValue() {
- return Unit.INSTANCE;
- }
-
- @Override
- public boolean equals(EntryStack<Unit> other, ComparisonContext context) {
- return this == other;
- }
-
- @Override
- public int hash(ComparisonContext context) {
- return System.identityHashCode(this);
- }
-
- @Override
- public int getZ() {
- return getBlitOffset();
- }
-
- @Override
- public void setZ(int z) {
- setBlitOffset(z);
- }
-
- @Override
- public <R> EntryStack<Unit> setting(Settings<R> settings, R value) {
- return this;
- }
-
- @Override
- public <R> EntryStack<Unit> removeSetting(Settings<R> settings) {
- return this;
- }
-
- @Override
- public EntryStack<Unit> clearSettings() {
- return this;
- }
-
- @Override
- public <T> T get(Settings<T> settings) {
- return settings.getDefaultValue();
- }
-}