aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java8
-rw-r--r--src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java8
-rw-r--r--src/main/java/me/shedaniel/rei/api/ClientHelper.java5
-rw-r--r--src/main/java/me/shedaniel/rei/api/DrawableConsumer.java3
-rw-r--r--src/main/java/me/shedaniel/rei/api/EntryStack.java6
-rw-r--r--src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java9
-rw-r--r--src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java3
-rw-r--r--src/main/java/me/shedaniel/rei/api/widgets/Button.java15
-rw-r--r--src/main/java/me/shedaniel/rei/api/widgets/Label.java15
-rw-r--r--src/main/java/me/shedaniel/rei/api/widgets/Tooltip.java11
-rw-r--r--src/main/java/me/shedaniel/rei/api/widgets/Widgets.java14
-rw-r--r--src/main/java/me/shedaniel/rei/gui/ConfigReloadingScreen.java9
-rw-r--r--src/main/java/me/shedaniel/rei/gui/ContainerScreenOverlay.java108
-rw-r--r--src/main/java/me/shedaniel/rei/gui/OverlaySearchField.java23
-rw-r--r--src/main/java/me/shedaniel/rei/gui/PreRecipeViewingScreen.java39
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeDisplayExporter.java16
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java61
-rw-r--r--src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java25
-rw-r--r--src/main/java/me/shedaniel/rei/gui/WarningAndErrorScreen.java73
-rw-r--r--src/main/java/me/shedaniel/rei/gui/config/entry/FilteringEntry.java60
-rw-r--r--src/main/java/me/shedaniel/rei/gui/config/entry/NoFilteringEntry.java8
-rw-r--r--src/main/java/me/shedaniel/rei/gui/config/entry/RecipeScreenTypeEntry.java21
-rw-r--r--src/main/java/me/shedaniel/rei/gui/credits/CreditsEntryListWidget.java29
-rw-r--r--src/main/java/me/shedaniel/rei/gui/credits/CreditsScreen.java19
-rw-r--r--src/main/java/me/shedaniel/rei/gui/entries/SimpleRecipeEntry.java9
-rw-r--r--src/main/java/me/shedaniel/rei/gui/subsets/SubsetsMenu.java9
-rw-r--r--src/main/java/me/shedaniel/rei/gui/subsets/entries/EntryStackMenuEntry.java11
-rw-r--r--src/main/java/me/shedaniel/rei/gui/subsets/entries/SubMenuEntry.java16
-rw-r--r--src/main/java/me/shedaniel/rei/gui/toast/CopyRecipeIdentifierToast.java11
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java38
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ClickableLabelWidget.java21
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/EntryListWidget.java101
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/EntryWidget.java41
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/FavoritesListWidget.java17
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/LabelWidget.java33
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/PanelWidget.java23
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/QueuedTooltip.java19
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeArrowWidget.java7
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/RecipeChoosePageWidget.java18
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/TabWidget.java12
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/TextFieldWidget.java60
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ClientHelperImpl.java15
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ConfigManagerImpl.java30
-rw-r--r--src/main/java/me/shedaniel/rei/impl/EmptyEntryStack.java9
-rw-r--r--src/main/java/me/shedaniel/rei/impl/EntryRegistryImpl.java2
-rw-r--r--src/main/java/me/shedaniel/rei/impl/FluidEntryStack.java36
-rw-r--r--src/main/java/me/shedaniel/rei/impl/InternalWidgets.java35
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ItemEntryStack.java39
-rw-r--r--src/main/java/me/shedaniel/rei/impl/ScreenHelper.java10
-rw-r--r--src/main/java/me/shedaniel/rei/impl/SearchArgument.java15
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/ArrowWidget.java7
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/BurningFireWidget.java7
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/ButtonWidget.java59
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/DrawableWidget.java5
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/FillRectangleDrawableConsumer.java3
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/LabelWidget.java82
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/PanelWidget.java27
-rw-r--r--src/main/java/me/shedaniel/rei/impl/widgets/TexturedDrawableConsumer.java20
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/DefaultPlugin.java8
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/beacon/DefaultBeaconBaseCategory.java9
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingCategory.java6
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/brewing/DefaultBrewingDisplay.java8
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/campfire/DefaultCampfireCategory.java3
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/composting/DefaultCompostingCategory.java8
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingCategory.java14
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/cooking/DefaultCookingDisplay.java4
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/crafting/DefaultCraftingCategory.java11
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/fuel/DefaultFuelCategory.java10
-rw-r--r--src/main/java/me/shedaniel/rei/plugin/information/DefaultInformationCategory.java22
69 files changed, 828 insertions, 710 deletions
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
index 25d5c716f..0fd28b111 100644
--- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
+++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java
@@ -330,10 +330,10 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
if (!alreadyAdded)
screenHooks.cloth_getChildren().add(ScreenHelper.getLastOverlay(true, false));
});
- ClothClientHooks.SCREEN_RENDER_POST.register((minecraftClient, screen, i, i1, v) -> {
+ ClothClientHooks.SCREEN_RENDER_POST.register((matrices, minecraftClient, screen, i, i1, v) -> {
if (shouldReturn(screen))
return;
- ScreenHelper.getLastOverlay().render(i, i1, v);
+ ScreenHelper.getLastOverlay().render(matrices, i, i1, v);
});
ClothClientHooks.SCREEN_MOUSE_DRAGGED.register((minecraftClient, screen, v, v1, i, v2, v3) -> {
if (shouldReturn(screen))
@@ -371,12 +371,12 @@ public class RoughlyEnoughItemsCore implements ClientModInitializer {
return ActionResult.SUCCESS;
return ActionResult.PASS;
});
- ClothClientHooks.SCREEN_LATE_RENDER.register((minecraftClient, screen, i, i1, v) -> {
+ ClothClientHooks.SCREEN_LATE_RENDER.register((matrices, minecraftClient, screen, i, i1, v) -> {
if (shouldReturn(screen))
return;
if (!ScreenHelper.isOverlayVisible())
return;
- ScreenHelper.getLastOverlay().lateRender(i, i1, v);
+ ScreenHelper.getLastOverlay().lateRender(matrices, i, i1, v);
});
ClothClientHooks.SCREEN_KEY_PRESSED.register((minecraftClient, screen, i, i1, i2) -> {
if (shouldReturn(screen))
diff --git a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
index 2898983b7..bce41cdf1 100644
--- a/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
+++ b/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsNetwork.java
@@ -65,7 +65,7 @@ public class RoughlyEnoughItemsNetwork implements ModInitializer {
ServerSidePacketRegistry.INSTANCE.register(DELETE_ITEMS_PACKET, (packetContext, packetByteBuf) -> {
ServerPlayerEntity player = (ServerPlayerEntity) packetContext.getPlayer();
if (player.getServer().getPermissionLevel(player.getGameProfile()) < player.getServer().getOpPermissionLevel()) {
- player.sendMessage(new TranslatableText("text.rei.no_permission_cheat").formatted(Formatting.RED), false);
+ player.sendMessage(new TranslatableText("text.rei.no_permission_cheat").method_27692(Formatting.RED), false);
return;
}
if (!player.inventory.getCursorStack().isEmpty())
@@ -74,7 +74,7 @@ public class RoughlyEnoughItemsNetwork implements ModInitializer {
ServerSidePacketRegistry.INSTANCE.register(CREATE_ITEMS_PACKET, (packetContext, packetByteBuf) -> {
ServerPlayerEntity player = (ServerPlayerEntity) packetContext.getPlayer();
if (player.getServer().getPermissionLevel(player.getGameProfile()) < player.getServer().getOpPermissionLevel()) {
- player.sendMessage(new TranslatableText("text.rei.no_permission_cheat").formatted(Formatting.RED), false);
+ player.sendMessage(new TranslatableText("text.rei.no_permission_cheat").method_27692(Formatting.RED), false);
return;
}
ItemStack stack = packetByteBuf.readItemStack();
@@ -118,9 +118,9 @@ public class RoughlyEnoughItemsNetwork implements ModInitializer {
ServerSidePacketRegistry.INSTANCE.sendToPlayer(player, NOT_ENOUGH_ITEMS_PACKET, buf);
}
} catch (IllegalStateException e) {
- player.sendSystemMessage(new TranslatableText(e.getMessage()).formatted(Formatting.RED));
+ player.sendSystemMessage(new TranslatableText(e.getMessage()).method_27692(Formatting.RED));
} catch (Exception e) {
- player.sendSystemMessage(new TranslatableText("error.rei.internal.error", e.getMessage()).formatted(Formatting.RED));
+ player.sendSystemMessage(new TranslatableText("error.rei.internal.error", e.getMessage()).method_27692(Formatting.RED));
e.printStackTrace();
}
} catch (Exception e) {
diff --git a/src/main/java/me/shedaniel/rei/api/ClientHelper.java b/src/main/java/me/shedaniel/rei/api/ClientHelper.java
index 20577b511..6d9fac19a 100644
--- a/src/main/java/me/shedaniel/rei/api/ClientHelper.java
+++ b/src/main/java/me/shedaniel/rei/api/ClientHelper.java
@@ -26,6 +26,7 @@ package me.shedaniel.rei.api;
import me.shedaniel.rei.impl.ClientHelperImpl;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
+import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.ApiStatus;
@@ -129,7 +130,7 @@ public interface ClientHelper {
* @param item the item to find
* @return the mod name with blue and italic formatting
*/
- String getFormattedModFromItem(Item item);
+ Text getFormattedModFromItem(Item item);
/**
* Gets the formatted mod from an identifier
@@ -137,7 +138,7 @@ public interface ClientHelper {
* @param identifier the identifier to find
* @return the mod name with blue and italic formatting
*/
- String getFormattedModFromIdentifier(Identifier identifier);
+ Text getFormattedModFromIdentifier(Identifier identifier);
/**
* Gets the mod from an identifier
diff --git a/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java b/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java
index cef309c89..3aaf05ba6 100644
--- a/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java
+++ b/src/main/java/me/shedaniel/rei/api/DrawableConsumer.java
@@ -24,11 +24,12 @@
package me.shedaniel.rei.api;
import net.minecraft.client.gui.DrawableHelper;
+import net.minecraft.client.util.math.MatrixStack;
import org.jetbrains.annotations.NotNull;
/**
* Consumer of a {@link DrawableHelper} and information of mouse and delta.
*/
public interface DrawableConsumer {
- void render(@NotNull DrawableHelper helper, int mouseX, int mouseY, float delta);
+ void render(@NotNull DrawableHelper helper, @NotNull MatrixStack matrices, int mouseX, int mouseY, float delta);
}
diff --git a/src/main/java/me/shedaniel/rei/api/EntryStack.java b/src/main/java/me/shedaniel/rei/api/EntryStack.java
index 23c232ee1..66c711b3d 100644
--- a/src/main/java/me/shedaniel/rei/api/EntryStack.java
+++ b/src/main/java/me/shedaniel/rei/api/EntryStack.java
@@ -33,12 +33,14 @@ import me.shedaniel.rei.impl.EmptyEntryStack;
import me.shedaniel.rei.impl.FluidEntryStack;
import me.shedaniel.rei.impl.ItemEntryStack;
import net.minecraft.client.resource.language.I18n;
+import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.fluid.Fluid;
import net.minecraft.item.Item;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.StringNbtReader;
+import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.registry.Registry;
@@ -248,7 +250,7 @@ public interface EntryStack {
return null;
}
- void render(Rectangle bounds, int mouseX, int mouseY, float delta);
+ void render(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta);
enum Type {
ITEM,
@@ -266,7 +268,7 @@ public interface EntryStack {
public static final Settings<Supplier<Boolean>> TOOLTIP_ENABLED = new Settings<>(TRUE);
public static final Settings<Supplier<Boolean>> TOOLTIP_APPEND_MOD = new Settings<>(TRUE);
public static final Settings<Supplier<Boolean>> RENDER_COUNTS = new Settings<>(TRUE);
- public static final Settings<Function<EntryStack, List<String>>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList());
+ public static final Settings<Function<EntryStack, List<Text>>> TOOLTIP_APPEND_EXTRA = new Settings<>(stack -> Collections.emptyList());
public static final Settings<Function<EntryStack, String>> COUNTS = new Settings<>(stack -> null);
private T defaultValue;
diff --git a/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java b/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java
index bade908d8..a7a4a4f04 100644
--- a/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java
+++ b/src/main/java/me/shedaniel/rei/api/OptimalEntryStack.java
@@ -24,19 +24,20 @@
package me.shedaniel.rei.api;
import me.shedaniel.math.Rectangle;
+import net.minecraft.client.util.math.MatrixStack;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
public interface OptimalEntryStack {
- default void optimisedRenderStart(float delta) {
+ default void optimisedRenderStart(MatrixStack matrices, float delta) {
}
- default void optimisedRenderBase(Rectangle bounds, int mouseX, int mouseY, float delta) {
+ default void optimisedRenderBase(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
}
- default void optimisedRenderOverlay(Rectangle bounds, int mouseX, int mouseY, float delta) {
+ default void optimisedRenderOverlay(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {
}
- default void optimisedRenderEnd(float delta) {
+ default void optimisedRenderEnd(MatrixStack matrices, float delta) {
}
}
diff --git a/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java b/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java
index a841549ef..72fd09335 100644
--- a/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java
+++ b/src/main/java/me/shedaniel/rei/api/TransferRecipeCategory.java
@@ -26,11 +26,12 @@ package me.shedaniel.rei.api;
import it.unimi.dsi.fastutil.ints.IntList;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.gui.widget.Widget;
+import net.minecraft.client.util.math.MatrixStack;
import org.jetbrains.annotations.ApiStatus;
import java.util.List;
public interface TransferRecipeCategory<T extends RecipeDisplay> extends RecipeCategory<T> {
@ApiStatus.OverrideOnly
- void renderRedSlots(List<Widget> widgets, Rectangle bounds, T display, IntList redSlots);
+ void renderRedSlots(MatrixStack matrices, List<Widget> widgets, Rectangle bounds, T display, IntList redSlots);
}
diff --git a/src/main/java/me/shedaniel/rei/api/widgets/Button.java b/src/main/java/me/shedaniel/rei/api/widgets/Button.java
index 24b3dd287..0a39cf91d 100644
--- a/src/main/java/me/shedaniel/rei/api/widgets/Button.java
+++ b/src/main/java/me/shedaniel/rei/api/widgets/Button.java
@@ -24,10 +24,13 @@
package me.shedaniel.rei.api.widgets;
import me.shedaniel.math.Point;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.text.Text;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.OptionalInt;
+import java.util.function.BiConsumer;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -76,12 +79,12 @@ public abstract class Button extends BaseWidget<Button> {
}
@NotNull
- public abstract String getText();
+ public abstract Text getText();
- public abstract void setText(@NotNull String text);
+ public abstract void setText(@NotNull Text text);
@NotNull
- public final Button text(@NotNull String text) {
+ public final Button text(@NotNull Text text) {
setText(text);
return this;
}
@@ -98,12 +101,12 @@ public abstract class Button extends BaseWidget<Button> {
}
@Nullable
- public abstract Consumer<Button> getOnRender();
+ public abstract BiConsumer<MatrixStack, Button> getOnRender();
- public abstract void setOnRender(@Nullable Consumer<Button> onRender);
+ public abstract void setOnRender(@Nullable BiConsumer<MatrixStack, Button> onRender);
@NotNull
- public final Button onRender(@Nullable Consumer<Button> onRender) {
+ public final Button onRender(@Nullable BiConsumer<MatrixStack, Button> onRender) {
setOnRender(onRender);
return this;
}
diff --git a/src/main/java/me/shedaniel/rei/api/widgets/Label.java b/src/main/java/me/shedaniel/rei/api/widgets/Label.java
index e51f504e9..a4b296b54 100644
--- a/src/main/java/me/shedaniel/rei/api/widgets/Label.java
+++ b/src/main/java/me/shedaniel/rei/api/widgets/Label.java
@@ -26,9 +26,12 @@ package me.shedaniel.rei.api.widgets;
import me.shedaniel.math.Point;
import me.shedaniel.rei.api.REIHelper;
import me.shedaniel.rei.gui.widget.WidgetWithBounds;
+import net.minecraft.client.util.math.MatrixStack;
+import net.minecraft.text.Text;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
@@ -100,14 +103,14 @@ public abstract class Label extends WidgetWithBounds {
* @return the consumer before render, null if not set.
*/
@Nullable
- public abstract Consumer<Label> getOnRender();
+ public abstract BiConsumer<MatrixStack, Label> getOnRender();
/**
* Sets the consumer before render.
*
* @param onRender the consumer before render.
*/
- public abstract void setOnRender(@Nullable Consumer<Label> onRender);
+ public abstract void setOnRender(@Nullable BiConsumer<MatrixStack, Label> onRender);
/**
* Sets the consumer before render.
@@ -116,7 +119,7 @@ public abstract class Label extends WidgetWithBounds {
* @return the label itself.
*/
@NotNull
- public final Label onRender(@Nullable Consumer<Label> onRender) {
+ public final Label onRender(@Nullable BiConsumer<MatrixStack, Label> onRender) {
setOnRender(onRender);
return this;
}
@@ -291,12 +294,12 @@ public abstract class Label extends WidgetWithBounds {
}
@NotNull
- public abstract String getText();