aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2023-05-29 20:50:29 +0800
committershedaniel <daniel@shedaniel.me>2023-05-29 20:50:29 +0800
commit42e0eae7e10d3db2c24d3554f00ca8ea59956c3f (patch)
tree2da44b193d6c78bfe3d2d79755b055fb324c59e0 /runtime/src/main/java
parentb027abb52a47ca33c521d7f65c19075a51699176 (diff)
downloadRoughlyEnoughItems-42e0eae7e10d3db2c24d3554f00ca8ea59956c3f.tar.gz
RoughlyEnoughItems-42e0eae7e10d3db2c24d3554f00ca8ea59956c3f.tar.bz2
RoughlyEnoughItems-42e0eae7e10d3db2c24d3554f00ca8ea59956c3f.zip
Fix merge issues
Diffstat (limited to 'runtime/src/main/java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringRuleOptionsScreen.java11
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringScreen.java19
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/TitleTextEntry.java6
-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/dragging/CurrentDraggingStack.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/AbstractDisplayViewingScreen.java3
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/RendererWrappedWidget.java4
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/VanillaWrappedWidget.java12
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayEntry.java6
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayHistoryWidget.java16
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesPanel.java8
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesTogglePanelButton.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/registry/category/CategoryRegistryImpl.java2
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/registry/screen/ScreenRegistryImpl.java1
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java2
17 files changed, 53 insertions, 54 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java
index be7bc0af9..5101a2f9d 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/ClientHelperImpl.java
@@ -65,6 +65,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.LazyLoadedValue;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.player.Inventory;
+import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.ApiStatus;
@@ -235,7 +236,7 @@ public class ClientHelperImpl implements ClientHelper {
return Long2LongMaps.EMPTY_MAP;
}
Long2LongOpenHashMap map = new Long2LongOpenHashMap();
- for (NonNullList<ItemStack> compartment : Minecraft.getInstance().player.getInventory().compartments) {
+ for (NonNullList<ItemStack> compartment : Minecraft.getInstance().player.inventory.compartments) {
for (ItemStack stack : compartment) {
long hash = definition.hash(null, stack, ComparisonContext.FUZZY);
long newCount = map.getOrDefault(hash, 0) + Math.max(0, stack.getCount());
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringRuleOptionsScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringRuleOptionsScreen.java
index ad96832cb..391032391 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringRuleOptionsScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/FilteringRuleOptionsScreen.java
@@ -23,8 +23,6 @@
package me.shedaniel.rei.impl.client.config.entries;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Lists;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import me.shedaniel.clothconfig2.gui.widget.DynamicElementListWidget;
@@ -271,8 +269,8 @@ public abstract class FilteringRuleOptionsScreen<T extends FilteringRule<?>> ext
@Override
public void render(PoseStack matrices, int index, int y, int x, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean isHovered, float delta) {
- RenderSystem.setShaderTexture(0, CONFIG_TEX);
- RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
+ Minecraft.getInstance().getTextureManager().bind(CONFIG_TEX);
+ RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.widget.rectangle.x = x + 3;
this.widget.rectangle.y = y;
this.widget.rectangle.width = entryWidth - 6;
@@ -336,11 +334,6 @@ public abstract class FilteringRuleOptionsScreen<T extends FilteringRule<?>> ext
return children;
}
- @Override
- public List<? extends NarratableEntry> narratables() {
- return Collections.emptyList();
- }
-
public class CategoryLabelWidget implements GuiEventListener {
private final Rectangle rectangle = new Rectangle();
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 49f1f85a2..3409915da 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
@@ -94,7 +94,24 @@ public class FilteringScreen extends Screen {
private List<FilteringListEntry> entries = Collections.emptyList();
private List<GuiEventListener> elements = Collections.emptyList();
- private record PointPair(Point firstPoint, @Nullable Point secondPoint) {}
+ private static class PointPair {
+ private final Point firstPoint;
+ @Nullable
+ private final Point secondPoint;
+
+ public PointPair(Point firstPoint, @Nullable Point secondPoint) {
+ this.firstPoint = firstPoint;
+ this.secondPoint = secondPoint;
+ }
+
+ public Point firstPoint() {
+ return firstPoint;
+ }
+
+ public Point secondPoint() {
+ return secondPoint;
+ }
+ }
private List<PointPair> points = new ArrayList<>();
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/TitleTextEntry.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/TitleTextEntry.java
index 3e2bdc48a..5cd105c3b 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/TitleTextEntry.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/config/entries/TitleTextEntry.java
@@ -28,7 +28,6 @@ import me.shedaniel.clothconfig2.api.AbstractConfigListEntry;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.chat.NarratorChatListener;
import net.minecraft.client.gui.components.events.GuiEventListener;
-import net.minecraft.client.gui.narration.NarratableEntry;
import net.minecraft.network.chat.Component;
import net.minecraft.util.Unit;
import org.jetbrains.annotations.ApiStatus;
@@ -79,9 +78,4 @@ public class TitleTextEntry extends AbstractConfigListEntry<Unit> {
public List<? extends GuiEventListener> children() {
return Collections.emptyList();
}
-
- @Override
- public List<? extends NarratableEntry> narratables() {
- return Collections.emptyList();
- }
}
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 175ac532a..d25d96c55 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
@@ -45,7 +45,6 @@ import net.fabricmc.api.Environment;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.events.GuiEventListener;
-import net.minecraft.client.gui.narration.NarratableEntry;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
@@ -227,11 +226,6 @@ public class SearchFilteringRule extends AbstractFilteringRule<SearchFilteringRu
}
@Override
- public List<? extends NarratableEntry> narratables() {
- return Lists.newArrayList();
- }
-
- @Override
public List<? extends GuiEventListener> children() {
return Lists.newArrayList();
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/dragging/CurrentDraggingStack.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/dragging/CurrentDraggingStack.java
index 8e1d2f475..52782b868 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/dragging/CurrentDraggingStack.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/dragging/CurrentDraggingStack.java
@@ -172,7 +172,7 @@ public class CurrentDraggingStack extends Widget implements LateRenderable, Drag
private boolean drop() {
if (entry != null && entry.dragging) {
- DraggedAcceptorResult result = visitor.acceptDraggedWithResult(this, entry.component);
+ DraggedAcceptorResult result = visitor.acceptDragged(this, entry.component);
entry.component.release(result);
entry = null;
return true;
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/AbstractDisplayViewingScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/AbstractDisplayViewingScreen.java
index 7a94833a8..5412a8a8e 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/AbstractDisplayViewingScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/AbstractDisplayViewingScreen.java
@@ -205,8 +205,7 @@ public abstract class AbstractDisplayViewingScreen extends Screen implements Dis
collection = tags.getFluids();
objects = CollectionUtils.map(widget.getEntries(), stack -> stack.<FluidStack>castValue().getFluid());
} else continue;
- TagKey<?> firstOrNull = CollectionUtils.findFirstOrNull(collection::iterator,
- key -> CollectionUtils.allMatch(objects, holder -> ((Holder<Object>) holder).is((TagKey<Object>) key)));
+ Map.Entry<ResourceLocation, ? extends Tag<?>> firstOrNull = CollectionUtils.findFirstOrNull(collection.getAllTags().entrySet(), entry -> entry.getValue().getValues().equals(objects));
if (firstOrNull != null) {
widget.tagMatch = firstOrNull.getKey();
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java
index bf3e392cd..46ddf61d7 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/screen/DefaultDisplayViewingScreen.java
@@ -29,8 +29,8 @@ import com.google.common.collect.Maps;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.Tesselator;
+import com.mojang.datafixers.util.Pair;
import com.mojang.math.Matrix4f;
-import it.unimi.dsi.fastutil.Pair;
import me.shedaniel.clothconfig2.api.ModifierKeyCode;
import me.shedaniel.clothconfig2.api.animator.ValueAnimator;
import me.shedaniel.math.Color;
@@ -449,7 +449,7 @@ public class DefaultDisplayViewingScreen extends AbstractDisplayViewingScreen {
for (Map.Entry<Rectangle, Pair<DisplaySpec, List<Widget>>> entry : recipeBounds.entrySet()) {
Rectangle bounds = entry.getKey();
if (bounds.contains(PointHelper.ofMouse())) {
- RecipeDisplayExporter.exportRecipeDisplay(bounds, entry.getValue().left(), entry.getValue().right(), true);
+ RecipeDisplayExporter.exportRecipeDisplay(bounds, entry.getValue().getFirst(), entry.getValue().getSecond(), true);
return true;
}
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/RendererWrappedWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/RendererWrappedWidget.java
index 97d9f3e3d..765f1276c 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/RendererWrappedWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/RendererWrappedWidget.java
@@ -50,8 +50,8 @@ public class RendererWrappedWidget extends WidgetWithBounds {
@Override
public List<? extends GuiEventListener> children() {
- if (renderer instanceof GuiEventListener listener)
- return Collections.singletonList(listener);
+ if (renderer instanceof GuiEventListener)
+ return Collections.singletonList((GuiEventListener) renderer);
return Collections.emptyList();
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/VanillaWrappedWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/VanillaWrappedWidget.java
index 2aacd5e73..e19977a20 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/VanillaWrappedWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/VanillaWrappedWidget.java
@@ -44,10 +44,10 @@ public class VanillaWrappedWidget extends Widget {
@Override
public void render(PoseStack matrices, int mouseX, int mouseY, float delta) {
- if (element instanceof GuiComponent component)
- component.setBlitOffset(getZ());
- if (element instanceof net.minecraft.client.gui.components.Widget widget)
- widget.render(matrices, mouseX, mouseY, delta);
+ if (element instanceof GuiComponent)
+ ((GuiComponent) element).setBlitOffset(getZ());
+ if (element instanceof net.minecraft.client.gui.components.Widget)
+ ((net.minecraft.client.gui.components.Widget) element).render(matrices, mouseX, mouseY, delta);
}
@Override
@@ -65,8 +65,8 @@ public class VanillaWrappedWidget extends Widget {
public void setFocused(@Nullable GuiEventListener guiEventListener) {
if (guiEventListener == element) {
super.setFocused(element);
- } else if (element instanceof ContainerEventHandler handler) {
- handler.setFocused(guiEventListener);
+ } else if (element instanceof ContainerEventHandler) {
+ ((ContainerEventHandler) element).setFocused(guiEventListener);
}
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayEntry.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayEntry.java
index b7540c87a..52246e6e2 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayEntry.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayEntry.java
@@ -23,6 +23,8 @@
package me.shedaniel.rei.impl.client.gui.widget.favorites.history;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Vector4f;
import me.shedaniel.clothconfig2.api.LazyResettable;
@@ -212,8 +214,8 @@ public class DisplayEntry extends WidgetWithBounds {
}
ClientHelperImpl.getInstance()
- .openDisplayViewingScreen(Map.of(CategoryRegistry.getInstance().get(display.getCategoryIdentifier()).getCategory(), List.of(display)),
- null, List.of(), List.of());
+ .openDisplayViewingScreen(ImmutableMap.of(CategoryRegistry.getInstance().get(display.getCategoryIdentifier()).getCategory(), Collections.singletonList(display)),
+ null, Collections.emptyList(), Collections.emptyList());
Widgets.produceClickSound();
return true;
}
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayHistoryWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayHistoryWidget.java
index d4d2cfb48..b27193060 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayHistoryWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/history/DisplayHistoryWidget.java
@@ -25,10 +25,12 @@ package me.shedaniel.rei.impl.client.gui.widget.favorites.history;
import com.google.common.collect.Iterables;
import com.mojang.blaze3d.systems.RenderSystem;
-import com.mojang.blaze3d.vertex.*;
+import com.mojang.blaze3d.vertex.BufferBuilder;
+import com.mojang.blaze3d.vertex.DefaultVertexFormat;
+import com.mojang.blaze3d.vertex.PoseStack;
+import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.math.Matrix4f;
import me.shedaniel.clothconfig2.ClothConfigInitializer;
-import me.shedaniel.clothconfig2.api.ModifierKeyCode;
import me.shedaniel.clothconfig2.api.ScissorsHandler;
import me.shedaniel.clothconfig2.api.animator.NumberAnimator;
import me.shedaniel.clothconfig2.api.animator.ValueAnimator;
@@ -49,11 +51,9 @@ import me.shedaniel.rei.impl.client.gui.widget.DisplayCompositeWidget;
import me.shedaniel.rei.impl.client.gui.widget.favorites.FavoritesListWidget;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen;
-import net.minecraft.client.renderer.GameRenderer;
-import net.minecraft.network.chat.Component;
-import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.util.Mth;
import org.jetbrains.annotations.Nullable;
+import org.lwjgl.opengl.GL11;
import java.util.ArrayList;
import java.util.Collections;
@@ -139,10 +139,9 @@ public class DisplayHistoryWidget extends WidgetWithBounds implements DraggableC
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
- RenderSystem.setShader(GameRenderer::getPositionColorShader);
Tesselator tesselator = Tesselator.getInstance();
BufferBuilder builder = tesselator.getBuilder();
- builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
+ builder.begin(GL11.GL_QUADS, DefaultVertexFormat.POSITION_COLOR);
float a = (float) (color >> 24 & 255) / 255.0F;
float r = (float) (color >> 16 & 255) / 255.0F;
@@ -169,10 +168,9 @@ public class DisplayHistoryWidget extends WidgetWithBounds implements DraggableC
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
- RenderSystem.setShader(GameRenderer::getPositionColorShader);
Tesselator tesselator = Tesselator.getInstance();
BufferBuilder builder = tesselator.getBuilder();
- builder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR);
+ builder.begin(GL11.GL_QUADS, DefaultVertexFormat.POSITION_COLOR);
float a = (float) (color >> 24 & 255) / 255.0F;
float r = (float) (color >> 16 & 255) / 255.0F;
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesPanel.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesPanel.java
index 6271768e4..e394c63b5 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesPanel.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesPanel.java
@@ -150,8 +150,8 @@ public class FavoritesPanel extends WidgetWithBounds {
@Nullable
public DraggableStack getHoveredStack(double mouseX, double mouseY) {
for (FavoritesPanelRow row : rows.get()) {
- if (row instanceof FavoritesPanelEntriesRow entriesRow) {
- DraggableStack hoveredStack = entriesRow.getHoveredStack(mouseX, mouseY);
+ if (row instanceof FavoritesPanelEntriesRow) {
+ DraggableStack hoveredStack = ((FavoritesPanelEntriesRow) row).getHoveredStack(mouseX, mouseY);
if (hoveredStack != null) {
return hoveredStack;
@@ -165,8 +165,8 @@ public class FavoritesPanel extends WidgetWithBounds {
@Nullable
public EntryStack<?> getFocusedStack(Point mouse) {
for (FavoritesPanelRow row : rows.get()) {
- if (row instanceof FavoritesPanelEntriesRow entriesRow) {
- EntryStack<?> focusedStack = entriesRow.getFocusedStack(mouse);
+ if (row instanceof FavoritesPanelEntriesRow) {
+ EntryStack<?> focusedStack = ((FavoritesPanelEntriesRow) row).getFocusedStack(mouse);
if (focusedStack != null) {
return focusedStack;
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesTogglePanelButton.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesTogglePanelButton.java
index 32415069b..5885e9c6a 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesTogglePanelButton.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/favorites/panel/FavoritesTogglePanelButton.java
@@ -57,7 +57,7 @@ public class FavoritesTogglePanelButton extends FadingFavoritesPanelButton {
@Override
protected boolean isAvailable(int mouseX, int mouseY) {
boolean expended = parent.favoritePanel.expendState.value();
- return parent.fullBounds.contains(mouseX, mouseY) || REIRuntime.getInstance().getOverlay().orElseThrow().getEntryList().containsMouse(new Point(mouseX, mouseY)) || expended;
+ return parent.fullBounds.contains(mouseX, mouseY) || REIRuntime.getInstance().getOverlay().orElseThrow(NullPointerException::new).getEntryList().containsMouse(new Point(mouseX, mouseY)) || expended;
}
@Override
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/category/CategoryRegistryImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/category/CategoryRegistryImpl.java
index 43d7ff0a7..32fd74685 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/category/CategoryRegistryImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/category/CategoryRegistryImpl.java
@@ -153,7 +153,7 @@ public class CategoryRegistryImpl implements CategoryRegistry {
@Override
public Optional<ButtonArea> getPlusButtonArea() {
- return Optional.of(bounds -> Objects.requireNonNullElseGet(this.plusButtonArea.get(bounds), () -> ButtonArea.defaultArea().get(bounds)));
+ return Optional.of(bounds -> MoreObjects.firstNonNull(this.plusButtonArea.get(bounds), ButtonArea.defaultArea().get(bounds)));
}
@Override
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/screen/ScreenRegistryImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/screen/ScreenRegistryImpl.java
index 3de04a6f9..d506104c5 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/screen/ScreenRegistryImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/registry/screen/ScreenRegistryImpl.java
@@ -53,6 +53,7 @@ import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.inventory.AbstractContainerMenu;
+import org.apache.commons.lang3.BooleanUtils;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java
index 2687b23ef..66358b823 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java
@@ -381,7 +381,7 @@ public class ViewsImpl implements Views {
}
InfoContext context = new InfoContext(display);
- Iterable<SlotAccessor> inputSlots = info != null ? Iterables.concat(info.getInputSlots(context), info.getInventorySlots(context.withDisplay(display))) : Collections.emptySet();
+ Iterable<SlotAccessor> inputSlots = info != null ? Iterables.concat(info.getInputSlots(context), info.getInventorySlots(context)) : Collections.emptySet();
int slotsCraftable = 0;
boolean containsNonEmpty = false;
List<EntryIngredient> requiredInput = display.getRequiredEntries();