aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-04-25 22:20:34 +0800
committershedaniel <daniel@shedaniel.me>2023-05-29 20:26:14 +0800
commitb5f662ce25d979c02b6412bc400757daa8153936 (patch)
tree79bedba2766ed2ab3689c5f7c22609eddc69c3ba /runtime/src/main/java
parentf3d0bf7296f184ca193477e9ea0a178a1f0ad739 (diff)
downloadRoughlyEnoughItems-b5f662ce25d979c02b6412bc400757daa8153936.tar.gz
RoughlyEnoughItems-b5f662ce25d979c02b6412bc400757daa8153936.tar.bz2
RoughlyEnoughItems-b5f662ce25d979c02b6412bc400757daa8153936.zip
Code refactor on entry lists
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java23
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/entry/filtering/rules/SearchFilteringRule.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java13
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/entry/PerformanceEntryImpl.java (renamed from runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/entry/EntryListEntry.java)4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java (renamed from runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryListEntryWidget.java)6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java817
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListSearchManager.java94
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListStackEntry.java193
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/entrylist/EntryListWidget.java (renamed from runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryListWidget.java)394
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/FavoritesListWidget.java280
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/listeners/FavoritesRegionListener.java84
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/listeners/FavoritesSystemRegionListener.java56
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FadingFavoritesPanelButton.java126
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesPanel.java179
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesTogglePanelButton.java75
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelEmptyRow.java52
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelEntriesRow.java211
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelRow.java33
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelSectionRow.java61
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/rows/FavoritesPanelSeparatorRow.java47
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/trash/TrashWidget.java101
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/EntryStacksRegionWidget.java (renamed from runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryStacksRegionWidget.java)22
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/RealRegionEntry.java9
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/RegionDraggableStack.java1
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/RegionEntryWidget.java (renamed from runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/RegionEntryListEntry.java)6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/RegionListener.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/region/RegionRenderingDebugger.java77
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/plugin/client/DefaultClientRuntimePlugin.java6
32 files changed, 1805 insertions, 1189 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java
index 469e6a0f1..9ed29fd92 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/REIRuntimeImpl.java
@@ -58,7 +58,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.*;
-import static me.shedaniel.rei.impl.client.gui.widget.EntryListWidget.entrySize;
+import static me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.entrySize;
@ApiStatus.Internal
@Environment(EnvType.CLIENT)
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java
index ab259a8b8..efde584ec 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/ConfigObjectImpl.java
@@ -243,7 +243,7 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
@Override
public boolean doesSnapToRows() {
- return advanced.accessibility.snapToRows;
+ return false;
}
@Override
@@ -631,7 +631,6 @@ public class ConfigObjectImpl implements ConfigObject, ConfigData {
@UsePercentage(min = 0.25, max = 4.0) private double entrySize = 1.0;
@Comment("Declares the position of the entry panel.") @ConfigEntry.Gui.EnumHandler(option = ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON)
private DisplayPanelLocation displayPanelLocation = DisplayPanelLocation.RIGHT;
- @Comment("Declares whether scrolled entry panel should snap to rows.") private boolean snapToRows = false;
@Comment("Declares how the scrollbar in composite screen should act.") private boolean compositeScrollBarPermanent = false;
private boolean toastDisplayedOnCopyIdentifier = true;
@Comment("Declares whether REI should use compact tabs for categories.") private boolean useCompactTabs = true;
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java
index ee603f7f6..7d563b8b0 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java
@@ -35,7 +35,6 @@ import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.math.impl.PointHelper;
import me.shedaniel.rei.api.client.REIRuntime;
-import me.shedaniel.rei.api.client.config.ConfigObject;
import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
import me.shedaniel.rei.api.client.registry.entry.EntryRegistry;
import me.shedaniel.rei.api.client.search.SearchFilter;
@@ -62,7 +61,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
-import static me.shedaniel.rei.impl.client.gui.widget.EntryListWidget.entrySize;
+import static me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.entrySize;
@ApiStatus.Internal
public class FilteringScreen extends Screen {
@@ -89,7 +88,7 @@ public class FilteringScreen extends Screen {
private Tooltip tooltip = null;
private List<EntryStack<?>> entryStacks = null;
private Rectangle innerBounds;
- private List<EntryListEntry> entries = Collections.emptyList();
+ private List<FilteringListEntry> entries = Collections.emptyList();
private List<GuiEventListener> elements = Collections.emptyList();
private Point selectionPoint = null;
@@ -128,7 +127,7 @@ public class FilteringScreen extends Screen {
this.hideButton = new Button(0, 0, Minecraft.getInstance().font.width(hideText) + 10, 20, hideText, button -> {
for (int i = 0; i < entryStacks.size(); i++) {
EntryStack<?> stack = entryStacks.get(i);
- EntryListEntry entry = entries.get(i);
+ FilteringListEntry entry = entries.get(i);
entry.getBounds().y = entry.backupY - scrolling.scrollAmountInt();
if (entry.isSelected() && !entry.isFiltered()) {
filteringEntry.configFiltered.add(stack);
@@ -143,7 +142,7 @@ public class FilteringScreen extends Screen {
this.showButton = new Button(0, 0, Minecraft.getInstance().font.width(showText) + 10, 20, showText, button -> {
for (int i = 0; i < entryStacks.size(); i++) {
EntryStack<?> stack = entryStacks.get(i);
- EntryListEntry entry = entries.get(i);
+ FilteringListEntry entry = entries.get(i);
entry.getBounds().y = entry.backupY - scrolling.scrollAmountInt();
if (entry.isSelected() && filteringEntry.configFiltered.remove(stack)) {
filteringEntry.edited = true;
@@ -215,7 +214,7 @@ public class FilteringScreen extends Screen {
if (bounds.isEmpty())
return;
ScissorsHandler.INSTANCE.scissor(bounds);
- for (EntryListEntry entry : entries)
+ for (FilteringListEntry entry : entries)
entry.clearStacks();
int skip = Math.max(0, Mth.floor(scrolling.scrollAmount() / (float) entrySize()));
int nextIndex = skip * innerBounds.width / entrySize();
@@ -223,7 +222,7 @@ public class FilteringScreen extends Screen {
BatchedEntryRendererManager manager = new BatchedEntryRendererManager();
for (; i < entryStacks.size(); i++) {
EntryStack<?> stack = entryStacks.get(i);
- EntryListEntry entry = entries.get(nextIndex);
+ FilteringListEntry entry = entries.get(nextIndex);
entry.getBounds().y = entry.backupY - scrolling.scrollAmountInt();
if (entry.getBounds().y > bounds.getMaxY())
break;
@@ -292,7 +291,7 @@ public class FilteringScreen extends Screen {
@Override
public boolean mouseDragged(double mouseX, double mouseY, int button, double dx, double dy) {
- if (scrolling.mouseDragged(mouseX, mouseY, button, dx, dy, ConfigObject.getInstance().doesSnapToRows(), entrySize()))
+ if (scrolling.mouseDragged(mouseX, mouseY, button, dx, dy))
return true;
return super.mouseDragged(mouseX, mouseY, button, dx, dy);
}
@@ -326,11 +325,11 @@ public class FilteringScreen extends Screen {
int slotsToPrepare = Math.max(entryStacks.size() * 3, width * pageHeight * 3);
int currentX = 0;
int currentY = 0;
- List<EntryListEntry> entries = Lists.newArrayList();
+ List<FilteringListEntry> entries = Lists.newArrayList();
for (int i = 0; i < slotsToPrepare; i++) {
int xPos = currentX * entrySize + innerBounds.x;
int yPos = currentY * entrySize + innerBounds.y;
- entries.add(new EntryListEntry(xPos, yPos, entrySize));
+ entries.add(new FilteringListEntry(xPos, yPos, entrySize));
currentX++;
if (currentX >= width) {
currentX = 0;
@@ -438,12 +437,12 @@ public class FilteringScreen extends Screen {
return true;
}
- private class EntryListEntry extends EntryWidget {
+ private class FilteringListEntry extends EntryWidget {
private int backupY;
private boolean filtered = false;
private boolean dirty = true;
- private EntryListEntry(int x, int y, int entrySize) {
+ private FilteringListEntry(int x, int y, int entrySize) {
super(new Point(x, y));
this.backupY = y;
getBounds().width = getBounds().height = entrySize;
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/entry/filtering/rules/SearchFilteringRule.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/entry/filtering/rules/SearchFilteringRule.java
index 0e48f1b97..175ac532a 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/entry/filtering/rules/SearchFilteringRule.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/entry/filtering/rules/SearchFilteringRule.java
@@ -26,9 +26,7 @@ package me.shedaniel.rei.impl.client.entry.filtering.rules;
import com.google.common.base.Suppliers;
import com.google.common.collect.Lists;
import com.mojang.blaze3d.vertex.PoseStack;
-import me.shedaniel.clothconfig2.api.ScissorsHandler;
import me.shedaniel.math.Rectangle;
-import me.shedaniel.rei.api.client.REIRuntime;
import me.shedaniel.rei.api.client.registry.entry.EntryRegistry;
import me.shedaniel.rei.api.client.search.SearchFilter;
import me.shedaniel.rei.api.client.search.SearchProvider;
@@ -36,7 +34,6 @@ import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.api.common.util.CollectionUtils;
import me.shedaniel.rei.impl.client.config.entries.FilteringEntry;
import me.shedaniel.rei.impl.client.config.entries.FilteringRuleOptionsScreen;
-import me.shedaniel.rei.impl.client.config.entries.FilteringScreen;
import me.shedaniel.rei.impl.client.entry.filtering.AbstractFilteringRule;
import me.shedaniel.rei.impl.client.entry.filtering.FilteringCache;
import me.shedaniel.rei.impl.client.entry.filtering.FilteringContext;
@@ -53,7 +50,6 @@ import net.minecraft.client.gui.screens.Screen;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.TranslatableComponent;
-import net.minecraft.util.Mth;
import net.minecraft.util.StringUtil;
import java.util.*;
@@ -67,7 +63,7 @@ import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
-import static me.shedaniel.rei.impl.client.gui.widget.EntryListWidget.entrySize;
+import static me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.entrySize;
@Environment(EnvType.CLIENT)
public class SearchFilteringRule extends AbstractFilteringRule<SearchFilteringRule> {
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java
index f1ed6e530..be1e28796 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/ScreenOverlayImpl.java
@@ -57,7 +57,6 @@ import me.shedaniel.rei.api.client.view.ViewSearchBuilder;
import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.api.common.plugins.PluginManager;
import me.shedaniel.rei.api.common.util.EntryStacks;
-import me.shedaniel.rei.api.common.util.ImmutableTextComponent;
import me.shedaniel.rei.impl.client.ClientHelperImpl;
import me.shedaniel.rei.impl.client.REIRuntimeImpl;
import me.shedaniel.rei.impl.client.config.ConfigManagerImpl;
@@ -69,6 +68,9 @@ import me.shedaniel.rei.impl.client.gui.modules.Menu;
import me.shedaniel.rei.impl.client.gui.modules.MenuEntry;
import me.shedaniel.rei.impl.client.gui.modules.entries.*;
import me.shedaniel.rei.impl.client.gui.widget.*;
+import me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListSearchManager;
+import me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget;
+import me.shedaniel.rei.impl.client.gui.widget.favorites.FavoritesListWidget;
import me.shedaniel.rei.impl.client.gui.widget.search.OverlaySearchField;
import me.shedaniel.rei.impl.common.util.Weather;
import net.minecraft.ChatFormatting;
@@ -97,7 +99,7 @@ import java.util.*;
import java.util.function.Consumer;
import java.util.function.Predicate;
-import static me.shedaniel.rei.impl.client.gui.widget.EntryListWidget.entrySize;
+import static me.shedaniel.rei.impl.client.gui.widget.entrylist.EntryListWidget.entrySize;
@ApiStatus.Internal
public class ScreenOverlayImpl extends ScreenOverlay {
@@ -600,7 +602,7 @@ public class ScreenOverlayImpl extends ScreenOverlay {
AbstractContainerScreen<?> containerScreen = (AbstractContainerScreen<?>) Minecraft.getInstance().screen;
int x = containerScreen.leftPos, y = containerScreen.topPos;
for (Slot slot : containerScreen.getMenu().slots) {
- if (!slot.hasItem() || !ENTRY_LIST_WIDGET.matches(EntryStacks.of(slot.getItem()))) {
+ if (!slot.hasItem() || !EntryListSearchManager.INSTANCE.matches(EntryStacks.of(slot.getItem()))) {
matrices.pushPose();
matrices.translate(0, 0, 500f);
fillGradient(matrices, x + slot.x, y + slot.y, x + slot.x + 16, y + slot.y + 16, 0xdc202020, 0xdc202020);
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java
index f489af074..26279cc36 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/PerformanceScreen.java
@@ -29,7 +29,7 @@ import me.shedaniel.clothconfig2.gui.widget.DynamicElementListWidget;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.common.plugins.REIPlugin;
import me.shedaniel.rei.api.common.plugins.REIPluginProvider;
-import me.shedaniel.rei.impl.client.gui.performance.entry.EntryListEntry;
+import me.shedaniel.rei.impl.client.gui.performance.entry.PerformanceEntryImpl;
import me.shedaniel.rei.impl.client.gui.performance.entry.SubCategoryListEntry;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
@@ -147,9 +147,9 @@ public class PerformanceScreen extends Screen {
list = new PerformanceEntryListWidget();
long[] totalTime = {0};
RoughlyEnoughItemsCore.PERFORMANCE_LOGGER.getStages().forEach((stage, inner) -> {
- List<EntryListEntry> entries = new ArrayList<>();
+ List<PerformanceEntryImpl> entries = new ArrayList<>();
inner.times().forEach((obj, time) -> {
- entries.add(new EntryListEntry(new TextComponent(obj instanceof Pair ? ((Pair<REIPluginProvider<?>, REIPlugin<?>>) obj).getFirst().getPluginProviderName() : Objects.toString(obj)), time));
+ entries.add(new PerformanceEntryImpl(new TextComponent(obj instanceof Pair ? ((Pair<REIPluginProvider<?>, REIPlugin<?>>) obj).getFirst().getPluginProviderName() : Objects.toString(obj)), time));
});
Collection<Long> values = inner.times().values();
long separateTime;
@@ -157,13 +157,13 @@ public class PerformanceScreen extends Screen {
separateTime = values.stream().collect(Collectors.summarizingLong(value -> value)).getSum();
}
if ((inner.totalNano() - separateTime) > 1000000) {
- entries.add(new EntryListEntry(new TextComponent("Miscellaneous Operations"), inner.totalNano() - separateTime));
+ entries.add(new PerformanceEntryImpl(new TextComponent("Miscellaneous Operations"), inner.totalNano() - separateTime));
}
totalTime[0] += Math.max(inner.totalNano(), separateTime);
- entries.sort(Comparator.<EntryListEntry>comparingLong(value -> value.time).reversed());
+ entries.sort(Comparator.<PerformanceEntryImpl>comparingLong(value -> value.time).reversed());
list.addItem(new SubCategoryListEntry(new TextComponent(stage), (List<PerformanceScreen.PerformanceEntry>) (List<? extends PerformanceScreen.PerformanceEntry>) entries, Math.max(inner.totalNano(), separateTime), false));
});
- list.children().add(0, new EntryListEntry(new TextComponent("Total Load Time"), totalTime[0]));
+ list.children().add(0, new PerformanceEntryImpl(new TextComponent("Total Load Time"), totalTime[0]));
addWidget(list);
}
@@ -176,7 +176,6 @@ public class PerformanceScreen extends Screen {
}
public static abstract class PerformanceEntry extends DynamicElementListWidget.ElementEntry<PerformanceEntry> {
-
}
private class PerformanceEntryListWidget extends DynamicElementListWidget<PerformanceEntry> {
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/entry/EntryListEntry.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/entry/PerformanceEntryImpl.java
index f20058525..794dfddd3 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/entry/EntryListEntry.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/performance/entry/PerformanceEntryImpl.java
@@ -38,11 +38,11 @@ import java.util.Collections;
import java.util.List;
@Environment(EnvType.CLIENT)
-public class EntryListEntry extends PerformanceScreen.PerformanceEntry {
+public class PerformanceEntryImpl extends PerformanceScreen.PerformanceEntry {
private final Component name;
public final long time;
- public EntryListEntry(Component name, long time) {
+ public PerformanceEntryImpl(Component name, long time) {
this.name = name;
this.time = time;
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryListEntryWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java
index e7b046bdd..0bf816fff 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryListEntryWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/DisplayedEntryWidget.java
@@ -36,10 +36,10 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.world.item.ItemStack;
-public abstract class EntryListEntryWidget extends EntryWidget {
+public abstract class DisplayedEntryWidget extends EntryWidget {
public int backupY;
- protected EntryListEntryWidget(Point point, int entrySize) {
+ protected DisplayedEntryWidget(Point point, int entrySize) {
super(point);
this.backupY = point.y;
getBounds().width = getBounds().height = entrySize;
@@ -92,7 +92,7 @@ public abstract class EntryListEntryWidget extends EntryWidget {
}
@Override
- protected boolean cancelDeleteItems(EntryStack<?> stack) {
+ public boolean cancelDeleteItems(EntryStack<?> stack) {
if (!interactable || !ConfigObject.getInstance().isGrabbingItems())
return super.cancelDeleteItems(stack);
if (ClientHelper.getInstance().isCheating() && !(Minecraft.getInstance().screen instanceof DisplayScreen)) {
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java
index a138f8d88..d034df359 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/EntryWidget.java
@@ -46,6 +46,7 @@ import me.shedaniel.rei.api.client.view.ViewSearchBuilder;
import me.shedaniel.rei.api.common.entry.EntryStack;
import me.shedaniel.rei.impl.client.REIRuntimeImpl;
import me.shedaniel.rei.impl.client.gui.ScreenOverlayImpl;
+import me.shedaniel.rei.impl.client.gui.widget.favorites.FavoritesListWidget;
import net.minecraft.ChatFormatting;
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
@@ -444,7 +445,7 @@ public class EntryWidget extends Slot implements DraggableStackProviderWidget {
}
@ApiStatus.Internal
- protected boolean cancelDeleteItems(EntryStack<?> stack) {
+ public boolean cancelDeleteItems(EntryStack<?> stack) {
return false;
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java
deleted file mode 100644
index 7c901515a..000000000
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/FavoritesListWidget.java
+++ /dev/null
@@ -1,817 +0,0 @@
-/*
- * This file is licensed under the MIT License, part of Roughly Enough Items.
- * Copyright (c) 2018, 2019, 2020, 2021, 2022 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.client.gui.widget;
-
-import com.google.common.collect.ImmutableList;
-import com.mojang.blaze3d.vertex.PoseStack;
-import com.mojang.blaze3d.vertex.Tesselator;
-import me.shedaniel.clothconfig2.ClothConfigInitializer;
-import me.shedaniel.clothconfig2.api.LazyResettable;
-import me.shedaniel.clothconfig2.api.ScissorsHandler;
-import me.shedaniel.clothconfig2.api.animator.NumberAnimator;
-import me.shedaniel.clothconfig2.api.animator.ProgressValueAnimator;
-import me.shedaniel.clothconfig2.api.animator.ValueAnimator;
-import me.shedaniel.clothconfig2.api.scroll.ScrollingContainer;
-import me.shedaniel.math.FloatingPoint;
-import me.shedaniel.math.Point;
-import me.shedaniel.math.Rectangle;
-import me.shedaniel.math.impl.PointHelper;
-import me.shedaniel.rei.api.client.REIRuntime;
-import me.shedaniel.rei.api.client.config.ConfigManager;
-import me.shedaniel.rei.api.client.config.ConfigObject;
-import me.shedaniel.rei.api.client.favorites.FavoriteEntry;
-import me.shedaniel.rei.api.client.favorites.FavoriteEntryType;
-import me.shedaniel.rei.api.client.favorites.SystemFavoriteEntryProvider;
-import me.shedaniel.rei.api.client.gui.AbstractContainerEventHandler;
-import me.shedaniel.rei.api.client.gui.drag.*;
-import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
-import me.shedaniel.rei.api.client.gui.widgets.Widget;
-import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds;
-import me.shedaniel.rei.api.client.overlay.OverlayListWidget;
-import me.shedaniel.rei.api.client.overlay.ScreenOverlay;
-import me.shedaniel.rei.api.client.util.ClientEntryStacks;
-import me.shedaniel.rei.api.common.entry.EntryStack;
-import me.shedaniel.rei.api.common.plugins.PluginManager;
-import me.shedaniel.rei.api.common.util.CollectionUtils;
-import me.shedaniel.rei.api.common.util.ImmutableTextComponent;
-import me.shedaniel.rei.impl.client.config.ConfigManagerImpl;
-import me.shedaniel.rei.impl.client.config.ConfigObjectImpl;
-import me.shedaniel.rei.impl.client.favorites.FavoriteEntryTypeRegistryImpl;
-import me.shedaniel.rei.impl.client.gui.widget.region.RealRegionEntry;
-import me.shedaniel.rei.impl.client.gui.widget.region.RegionDraggableStack;
-import me.shedaniel.rei.impl.client.gui.widget.region.RegionEntryListEntry;
-import me.shedaniel.rei.impl.client.gui.widget.region.RegionListener;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.components.events.GuiEventListener;
-import net.minecraft.client.gui.screens.Screen;
-import net.minecraft.client.renderer.MultiBufferSource;
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.TranslatableComp