diff options
| author | shedaniel <daniel@shedaniel.me> | 2020-03-07 03:10:43 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2020-03-07 03:10:43 +0800 |
| commit | 250159221c07f884252a37daf00c74f41cf69d52 (patch) | |
| tree | 702aef7062c1d7a8ddfcfa686076e55030bb334f | |
| parent | 12223ae029f3d206ebb19ba0cd134e3c36827315 (diff) | |
| download | RoughlyEnoughItems-250159221c07f884252a37daf00c74f41cf69d52.tar.gz RoughlyEnoughItems-250159221c07f884252a37daf00c74f41cf69d52.tar.bz2 RoughlyEnoughItems-250159221c07f884252a37daf00c74f41cf69d52.zip | |
stuff
Signed-off-by: shedaniel <daniel@shedaniel.me>
35 files changed, 113 insertions, 119 deletions
diff --git a/.github/workflows/curseforge.yml b/.github/workflows/curseforge.yml index 63e2eea4c..e6898fdc6 100644 --- a/.github/workflows/curseforge.yml +++ b/.github/workflows/curseforge.yml @@ -1,4 +1,4 @@ -name: Java CI +name: CF CI on: push: @@ -18,4 +18,4 @@ jobs: - name: Upload to CurseForge run: ./gradlew clean build curseforge --refresh-dependencies --stacktrace env: - CF_API_KEY: ${{ secrets.CF_API_KEY }} + danielshe_curse_api_key: ${{ secrets.CF_API_KEY }} diff --git a/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java b/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java index d240efa91..4b28e239f 100644 --- a/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java +++ b/src/main/java/me/shedaniel/rei/api/AutoTransferHandler.java @@ -30,6 +30,8 @@ import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.ingame.ContainerScreen; import net.minecraft.container.Container; +import org.jetbrains.annotations.ApiStatus; +import org.spongepowered.asm.mixin.injection.Inject; import java.util.function.Supplier; @@ -104,6 +106,7 @@ public interface AutoTransferHandler { } } + @ApiStatus.Internal final class ResultImpl implements Result { private boolean successful, applicable; private String errorKey; @@ -155,6 +158,7 @@ public interface AutoTransferHandler { } } + @ApiStatus.Internal final class ContextImpl implements Context { boolean actuallyCrafting; ContainerScreen<?> containerScreen; diff --git a/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java b/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java index 5348d2196..e44e7dd9e 100644 --- a/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java +++ b/src/main/java/me/shedaniel/rei/api/BaseBoundsHandler.java @@ -31,6 +31,7 @@ import java.util.function.Supplier; public interface BaseBoundsHandler extends DisplayHelper.DisplayBoundsHandler<Screen> { + @SuppressWarnings("deprecation") static BaseBoundsHandler getInstance() { return DisplayHelper.getInstance().getBaseBoundsHandler(); } diff --git a/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/src/main/java/me/shedaniel/rei/api/ClientHelper.java index d0f310649..20577b511 100644 --- a/src/main/java/me/shedaniel/rei/api/ClientHelper.java +++ b/src/main/java/me/shedaniel/rei/api/ClientHelper.java @@ -33,6 +33,7 @@ import java.util.List; import java.util.Map; public interface ClientHelper { + /** * @return the api instance of {@link ClientHelperImpl} */ diff --git a/src/main/java/me/shedaniel/rei/api/ConfigManager.java b/src/main/java/me/shedaniel/rei/api/ConfigManager.java index 03b1d9731..e171ffc3c 100644 --- a/src/main/java/me/shedaniel/rei/api/ConfigManager.java +++ b/src/main/java/me/shedaniel/rei/api/ConfigManager.java @@ -32,10 +32,17 @@ import java.util.List; public interface ConfigManager { + /** + * @return the api instance of {@link me.shedaniel.rei.impl.ConfigManagerImpl} + */ static ConfigManager getInstance() { return RoughlyEnoughItemsCore.getConfigManager(); } + /** + * @return the list of favourites + * @deprecated {@link ConfigObject#getFavorites()} + */ @ApiStatus.ScheduledForRemoval @Deprecated default List<EntryStack> getFavorites() { diff --git a/src/main/java/me/shedaniel/rei/api/ConfigObject.java b/src/main/java/me/shedaniel/rei/api/ConfigObject.java index 09566c873..56c57125a 100644 --- a/src/main/java/me/shedaniel/rei/api/ConfigObject.java +++ b/src/main/java/me/shedaniel/rei/api/ConfigObject.java @@ -36,6 +36,9 @@ import java.util.List; public interface ConfigObject { + /** + * @return the api instance of {@link me.shedaniel.rei.impl.ConfigObjectImpl} + */ static ConfigObject getInstance() { return ((ConfigManagerImpl) ConfigManager.getInstance()).getConfig(); } diff --git a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java index 0b6a709a9..246850cc7 100644 --- a/src/main/java/me/shedaniel/rei/api/DisplayHelper.java +++ b/src/main/java/me/shedaniel/rei/api/DisplayHelper.java @@ -37,6 +37,9 @@ import static net.minecraft.util.ActionResult.PASS; public interface DisplayHelper { + /** + * @return the api instance of {@link me.shedaniel.rei.impl.DisplayHelperImpl} + */ static DisplayHelper getInstance() { return RoughlyEnoughItemsCore.getDisplayHelper(); } @@ -101,9 +104,11 @@ public interface DisplayHelper { * Gets the base bounds handler api for exclusion zones * * @return the base bounds handler - * @see BaseBoundsHandler#getInstance() + * @deprecated {@link BaseBoundsHandler#getInstance()} */ @ApiStatus.Internal + @Deprecated + @ApiStatus.ScheduledForRemoval BaseBoundsHandler getBaseBoundsHandler(); interface DisplayBoundsHandler<T> extends OverlayDecider { diff --git a/src/main/java/me/shedaniel/rei/api/EntryRegistry.java b/src/main/java/me/shedaniel/rei/api/EntryRegistry.java index ca6fb7172..80f25cbf6 100644 --- a/src/main/java/me/shedaniel/rei/api/EntryRegistry.java +++ b/src/main/java/me/shedaniel/rei/api/EntryRegistry.java @@ -35,6 +35,9 @@ import java.util.List; public interface EntryRegistry { + /** + * @return the api instance of {@link me.shedaniel.rei.impl.EntryRegistryImpl} + */ static EntryRegistry getInstance() { return RoughlyEnoughItemsCore.getEntryRegistry(); } diff --git a/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java b/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java index d48e0e481..4ee36d11c 100644 --- a/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java +++ b/src/main/java/me/shedaniel/rei/api/LiveRecipeGenerator.java @@ -30,6 +30,9 @@ import java.util.Optional; public interface LiveRecipeGenerator<T extends RecipeDisplay> { + /** + * @return the identifier of the category the recipes goes to. + */ Identifier getCategoryIdentifier(); default Optional<List<T>> getRecipeFor(EntryStack entry) { diff --git a/src/main/java/me/shedaniel/rei/api/REIHelper.java b/src/main/java/me/shedaniel/rei/api/REIHelper.java index 99a5e0415..578d3d4bf 100644 --- a/src/main/java/me/shedaniel/rei/api/REIHelper.java +++ b/src/main/java/me/shedaniel/rei/api/REIHelper.java @@ -23,13 +23,19 @@ package me.shedaniel.rei.api; +import me.shedaniel.rei.gui.widget.QueuedTooltip; import me.shedaniel.rei.gui.widget.TextFieldWidget; import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.item.ItemStack; +import org.jetbrains.annotations.Nullable; import java.util.List; public interface REIHelper { + + /** + * @return the instance of {@link REIHelper} + */ static REIHelper getInstance() { return ScreenHelper.getInstance(); } @@ -39,4 +45,7 @@ public interface REIHelper { TextFieldWidget getSearchTextField(); List<ItemStack> getInventoryStacks(); + + void addTooltip(@Nullable QueuedTooltip tooltip); + } diff --git a/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java b/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java index f7bd91367..220318753 100644 --- a/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java +++ b/src/main/java/me/shedaniel/rei/api/REIPluginEntry.java @@ -33,6 +33,10 @@ import org.jetbrains.annotations.ApiStatus; */ public interface REIPluginEntry { + /** + * @return the minimum version for the REI plugin to load + * @deprecated deprecated due to the lack of need of this method, please declare conflicts with fabric.mod.json + */ @ApiStatus.ScheduledForRemoval @Deprecated default SemanticVersion getMinimumVersion() throws VersionParsingException { @@ -40,18 +44,14 @@ public interface REIPluginEntry { } /** - * Gets the priority of the plugin. - * - * @return the priority + * @return the priority of the plugin, the smaller the number, the earlier it is called. */ default int getPriority() { return 0; } /** - * Get the identifier of the plugin - * - * @return the identifier + * @return the unique identifier of the plugin. */ Identifier getPluginIdentifier(); diff --git a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java index 71fda0d06..9d58d5530 100644 --- a/src/main/java/me/shedaniel/rei/api/RecipeHelper.java +++ b/src/main/java/me/shedaniel/rei/api/RecipeHelper.java @@ -39,6 +39,9 @@ import java.util.function.Predicate; public interface RecipeHelper { + /** + * @return the api instance of {@link me.shedaniel.rei.impl.RecipeHelperImpl} + */ static RecipeHelper getInstance() { return RoughlyEnoughItemsCore.getRecipeHelper(); } diff --git a/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java b/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java index b6c9b18a6..900faa39e 100644 --- a/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java +++ b/src/main/java/me/shedaniel/rei/api/TransferRecipeDisplay.java @@ -30,8 +30,14 @@ import java.util.List; public interface TransferRecipeDisplay extends RecipeDisplay { + /** + * @return the width of the crafting grid. + */ int getWidth(); + /** + * @return the height of the crafting grid. + */ int getHeight(); List<List<EntryStack>> getOrganisedInputEntries(ContainerInfo<Container> containerInfo, Container container); diff --git a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java index f0ad31a88..46cf478f0 100644 --- a/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java +++ b/src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java @@ -503,7 +503,7 @@ public class ContainerScreenOverlay extends WidgetWithBounds { public boolean mouseScrolled(double i, double j, double amount) { if (!ScreenHelper.isOverlayVisible()) return false; - if (isInside(PointHelper.fromMouse())) { + if (isInside(PointHelper.ofMouse())) { if (!ConfigObject.getInstance().isEntryListWidgetScrolled()) { if (amount > 0 && leftButton.enabled) leftButton.onPressed(); diff --git a/src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java b/src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java index 2e61a9bcc..b33aca3b7 100644 --- a/src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java +++ b/src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java @@ -74,7 +74,7 @@ public class OverlaySearchField extends TextFieldWidget { public void laterRender(int int_1, int int_2, float float_1) { RenderSystem.disableDepthTest(); - setEditableColor(isMain && ContainerScreenOverlay.getEntryListWidget().getAllStacks().isEmpty() && !getText().isEmpty() ? 16733525 : isSearching && isMain ? -852212 : (containsMouse(PointHelper.fromMouse()) || isFocused()) ? (REIHelper.getInstance().isDarkThemeEnabled() ? -17587 : -1) : -6250336); + setEditableColor(isMain && ContainerScreenOverlay.getEntryListWidget().getAllStacks().isEmpty() && !getText().isEmpty() ? 16733525 : isSearching && isMain ? -852212 : (containsMouse(PointHelper.ofMouse()) || isFocused()) ? (REIHelper.getInstance().isDarkThemeEnabled() ? -17587 : -1) : -6250336); setSuggestion(!isFocused() && getText().isEmpty() ? I18n.translate("text.rei.search.field.suggestion") : null); super.render(int_1, int_2, float_1); RenderSystem.enableDepthTest(); @@ -82,7 +82,7 @@ public class OverlaySearchField extends TextFieldWidget { @Override protected void renderSuggestion(int x, int y) { - if (containsMouse(PointHelper.fromMouse()) || isFocused()) + if (containsMouse(PointHelper.ofMouse()) || isFocused()) this.font.drawWithShadow(this.font.trimToWidth(this.getSuggestion(), this.getWidth()), x, y, REIHelper.getInstance().isDarkThemeEnabled() ? 0xccddaa3d : 0xddeaeaea); else this.font.drawWithShadow(this.font.trimToWidth(this.getSuggestion(), this.getWidth()), x, y, -6250336); diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index e6e5bccdc..f058ee63a 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -458,7 +458,7 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen { if (export.matchesKey(keyCode, scanCode)) { for (Map.Entry<Rectangle, List<Widget>> entry : recipeBounds.entrySet()) { Rectangle bounds = entry.getKey(); - if (bounds.contains(PointHelper.fromMouse())) { + if (bounds.contains(PointHelper.ofMouse())) { RecipeDisplayExporter.exportRecipeDisplay(bounds, entry.getValue()); break; } @@ -507,13 +507,13 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen { for (Element listener : children()) if (listener.mouseScrolled(i, j, amount)) return true; - if (getBounds().contains(PointHelper.fromMouse())) { + if (getBounds().contains(PointHelper.ofMouse())) { if (amount > 0 && recipeBack.enabled) recipeBack.onPressed(); else if (amount < 0 && recipeNext.enabled) recipeNext.onPressed(); } - if ((new Rectangle(bounds.x, bounds.y - 28, bounds.width, 28)).contains(PointHelper.fromMouse())) { + if ((new Rectangle(bounds.x, bounds.y - 28, bounds.width, 28)).contains(PointHelper.ofMouse())) { if (amount > 0 && categoryBack.enabled) categoryBack.onPressed(); else if (amount < 0 && categoryNext.enabled) diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java index 7ba09f59d..d20000a30 100644 --- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java @@ -327,7 +327,7 @@ public class VillagerRecipeViewingScreen extends Screen implements RecipeScreen for (Element listener : children()) if (listener.mouseScrolled(double_1, double_2, double_3)) return true; - if (bounds.contains(PointHelper.fromMouse())) { + if (bounds.contains(PointHelper.ofMouse())) { if (double_3 < 0 && categoryMap.get(categories.get(selectedCategoryIndex)).size() > 1) { selectedRecipeIndex++; if (selectedRecipeIndex >= categoryMap.get(categories.get(selectedCategoryIndex)).size()) @@ -392,7 +392,7 @@ public class VillagerRecipeViewingScreen extends Screen implements RecipeScreen if (buttonWidgets.get(i).getBounds().getMaxY() > scrollListBounds.getMinY() && buttonWidgets.get(i).getBounds().getMinY() < scrollListBounds.getMaxY()) { recipeRenderers.get(i).setZ(1); recipeRenderers.get(i).render(buttonWidgets.get(i).getBounds(), mouseX, mouseY, delta); - ScreenHelper.getLastOverlay().addTooltip(recipeRenderers.get(i).getTooltip(mouseX, mouseY)); + REIHelper.getInstance().addTooltip(recipeRenderers.get(i).getTooltip(mouseX, mouseY)); } } double maxScroll = getMaxScrollPosition(); @@ -405,7 +405,7 @@ public class VillagerRecipeViewingScreen extends Screen implements RecipeScreen height = Math.max(10, height); int minY = (int) Math.min(Math.max((int) scrollAmount * (scrollListBounds.height - 2 - height) / getMaxScroll() + scrollListBounds.y + 1, scrollListBounds.y + 1), scrollListBounds.getMaxY() - 1 - height); int scrollbarPositionMinX = scrollListBounds.getMaxX() - 6, scrollbarPositionMaxX = scrollListBounds.getMaxX() - 1; - boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse()); + boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.ofMouse()); float bottomC = (hovered ? .67f : .5f) * (REIHelper.getInstance().isDarkThemeEnabled() ? 0.8f : 1f); float topC = (hovered ? .87f : .67f) * (REIHelper.getInstance().isDarkThemeEnabled() ? 0.8f : 1f); RenderSystem.disableTexture(); diff --git a/src/main/java/me/shedaniel/rei/gui/config/entry/FilteringEntry.java b/src/main/java/me/shedaniel/rei/gui/config/entry/FilteringEntry.java index 1fbb235fc..29fb33c92 100644 --- a/src/main/java/me/shedaniel/rei/gui/config/entry/FilteringEntry.java +++ b/src/main/java/me/shedaniel/rei/gui/config/entry/FilteringEntry.java @@ -223,7 +223,7 @@ public class FilteringEntry extends AbstractConfigListEntry<List<EntryStack>> { if (selectionPoint != null) { Point p = secondPoint; if (p == null) { - p = PointHelper.fromMouse(); + p = PointHelper.ofMouse(); p.translate(0, (int) scroll); } int left = Math.min(p.x, selectionPoint.x); @@ -272,7 +272,7 @@ public class FilteringEntry extends AbstractConfigListEntry<List<EntryStack>> { int scrollbarPositionMinX = getScrollbarMinX(); int scrollbarPositionMaxX = scrollbarPositionMinX + 6; - boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.fromMouse()); + boolean hovered = (new Rectangle(scrollbarPositionMinX, minY, scrollbarPositionMaxX - scrollbarPositionMinX, height)).contains(PointHelper.ofMouse()); float bottomC = (hovered ? .67f : .5f) * (REIHelper.getInstance().isDarkThemeEnabled() ? 0.8f : 1f); float topC = (hovered ? .87f : .67f) * (REIHelper.getInstance().isDarkThemeEnabled() ? 0.8f : 1f); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java index 90a3ab511..3b1817d18 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/AutoCraftingButtonWidget.java @@ -148,9 +148,9 @@ public class AutoCraftingButtonWidget extends ButtonWidget { if (getTooltips().isPresent()) if (!focused && containsMouse(mouseX, mouseY)) - ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); + REIHelper.getInstance().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); else if (focused) - ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n"))); + REIHelper.getInstance().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n"))); } @Override @@ -179,7 +179,7 @@ public class AutoCraftingButtonWidget extends ButtonWidget { @Override public boolean keyPressed(int int_1, int int_2, int int_3) { - if (displaySupplier.get().getRecipeLocation().isPresent() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesKey(int_1, int_2) && containsMouse(PointHelper.fromMouse())) { + if (displaySupplier.get().getRecipeLocation().isPresent() && ConfigObject.getInstance().getCopyRecipeIdentifierKeybind().matchesKey(int_1, int_2) && containsMouse(PointHelper.ofMouse())) { minecraft.keyboard.setClipboard(displaySupplier.get().getRecipeLocation().get().toString()); if (ConfigObject.getInstance().isToastDisplayedOnCopyIdentifier()) { CopyRecipeIdentifierToast.addToast(I18n.translate("msg.rei.copied_recipe_id"), I18n.translate("msg.rei.recipe_id_details", displaySupplier.get().getRecipeLocation().get().toString())); diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java index 06c80b5cd..0fd86752d 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java @@ -27,7 +27,6 @@ import com.mojang.blaze3d.systems.RenderSystem; import me.shedaniel.math.api.Point; import me.shedaniel.math.api.Rectangle; import me.shedaniel.rei.api.REIHelper; -import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.gui.Element; import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.sound.SoundEvents; @@ -155,9 +154,9 @@ public abstract class ButtonWidget extends WidgetWithBounds { if (getTooltips().isPresent()) if (!focused && containsMouse(mouseX, mouseY)) - ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); + REIHelper.getInstance().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); else if (focused) - ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n"))); + REIHelper.getInstance().addTooltip(QueuedTooltip.create(new Point(x + width / 2, y + height / 2), getTooltips().get().split("\n"))); } public boolean isHovered(int mouseX, int mouseY) { diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java index 42b0abcc5..ad40fcd1b 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java @@ -25,7 +25,6 @@ package me.shedaniel.rei.gui.widget; import me.shedaniel.math.api.Point; import me.shedaniel.rei.api.REIHelper; -import me.shedaniel.rei.impl.ScreenHelper; import org.jetbrains.annotations.ApiStatus; public abstract class ClickableLabelWidget extends LabelWidget { @@ -79,9 +78,9 @@ public abstract class ClickableLabelWidget extends LabelWidget { protected void drawTooltips(int mouseX, int mouseY) { if (isClickable() && getTooltips().isPresent()) if (!focused && containsMouse(mouseX, mouseY)) - ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); + REIHelper.getInstance().addTooltip(QueuedTooltip.create(getTooltips().get().split("\n"))); else if (focused) - ScreenHelper.getLastOverlay().addTooltip(QueuedTooltip.create(getPosition(), getTooltips().get().split("\n"))); + REIHelper.getInstance().addTooltip(QueuedTooltip.create(getPosition(), getTooltips().get().split("\n"))); } public int getHoveredColor() { diff --git a/src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java index a09355373..d9e4e04d1 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/DraggableWidget.java @@ -60,7 +60,7 @@ public abstract class DraggableWidget extends WidgetWithBounds { @Override public boolean mouseDragged(double double_1, double dou |
