Bump deps

This commit is contained in:
drcrazy 2022-06-06 18:56:16 +03:00
parent 0845d6618b
commit 6cde366510
12 changed files with 47 additions and 46 deletions

View file

@ -33,6 +33,7 @@ import me.shedaniel.rei.api.client.entry.renderer.AbstractEntryRenderer;
import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer;
import me.shedaniel.rei.api.client.gui.AbstractRenderer;
import me.shedaniel.rei.api.client.gui.widgets.Tooltip;
import me.shedaniel.rei.api.client.gui.widgets.TooltipContext;
import me.shedaniel.rei.api.client.gui.widgets.Widget;
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
@ -283,16 +284,15 @@ public class ReiPlugin implements REIClientPlugin {
});
}
public static Widget createEnergyDisplay(Rectangle bounds, double energy, EntryAnimation animation, Function<Point, Tooltip> tooltipBuilder) {
public static Widget createEnergyDisplay(Rectangle bounds, double energy, EntryAnimation animation, Function<TooltipContext, Tooltip> tooltipBuilder) {
return new EnergyEntryWidget(bounds, animation).entry(
ClientEntryStacks.of(new AbstractRenderer() {
@Override
public void render(MatrixStack matrices, Rectangle bounds, int mouseX, int mouseY, float delta) {}
@Override
@Nullable
public Tooltip getTooltip(Point mouse) {
return tooltipBuilder.apply(mouse);
public @Nullable Tooltip getTooltip(TooltipContext context) {
return tooltipBuilder.apply(context);
}
})
).notFavoritesInteractable();
@ -399,8 +399,8 @@ public class ReiPlugin implements REIClientPlugin {
@Override
@Nullable
public Tooltip getTooltip(EntryStack<FluidStack> entry, Point mouse) {
return parent.getTooltip(entry, mouse);
public Tooltip getTooltip(EntryStack<FluidStack> entry, TooltipContext context) {
return parent.getTooltip(entry, context);
}
}

View file

@ -25,6 +25,7 @@
package techreborn.client.compat.rei.fluidgenerator;
import com.google.common.collect.Lists;
import me.shedaniel.math.Point;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.api.client.ClientHelper;
import me.shedaniel.rei.api.client.gui.Renderer;
@ -73,13 +74,13 @@ public class FluidGeneratorRecipeCategory implements DisplayCategory<FluidGenera
public List<Widget> setupDisplay(FluidGeneratorRecipeDisplay recipeDisplay, Rectangle bounds) {
List<Widget> widgets = Lists.newArrayList();
widgets.add(Widgets.createRecipeBase(bounds));
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 108, bounds.y + 8, 14, 50), recipeDisplay.getTotalEnergy(), ReiPlugin.EntryAnimation.upwards(5000), point -> {
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 108, bounds.y + 8, 14, 50), recipeDisplay.getTotalEnergy(), ReiPlugin.EntryAnimation.upwards(5000), tooltipContext -> {
List<Text> list = Lists.newArrayList();
list.add(Text.of("Energy"));
list.add(Text.translatable("techreborn.jei.recipe.generator.total", recipeDisplay.getTotalEnergy()).formatted(Formatting.GRAY));
list.add(Text.of(""));
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
return Tooltip.create(point, list);
return Tooltip.create(tooltipContext.getPoint(), list);
}));
widgets.add(ReiPlugin.createFluidDisplay(new Rectangle(bounds.x + 16, bounds.y + 8, 16, 50), recipeDisplay.getInputEntries().get(0).get(0).cast(), ReiPlugin.EntryAnimation.downwards(5000)));
widgets.add(ReiPlugin.createProgressBar(bounds.x + 76 - 16, bounds.y + 48 - 19, 5000, GuiBuilder.ProgressDirection.RIGHT));

View file

@ -76,13 +76,13 @@ public class FluidReplicatorRecipeCategory implements DisplayCategory<FluidRepli
List<Widget> widgets = Lists.newArrayList();
widgets.add(Widgets.createRecipeBase(bounds));
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 8, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), point -> {
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 8, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), tooltipContext -> {
List<Text> list = Lists.newArrayList();
list.add(Text.of("Energy"));
list.add(Text.translatable("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
list.add(Text.of(""));
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
return Tooltip.create(point, list);
return Tooltip.create(tooltipContext.getPoint(), list);
}));
widgets.add(Widgets.createSlot(new Point(bounds.x + 46, bounds.y + 26)).entries(recipeDisplay.getInputEntries().get(0)).markInput());

View file

@ -49,13 +49,13 @@ public abstract class AbstractEnergyConsumingMachineCategory<R extends RebornRec
public List<Widget> setupDisplay(MachineRecipeDisplay<R> recipeDisplay, Rectangle bounds) {
List<Widget> widgets = Lists.newArrayList();
widgets.add(Widgets.createRecipeBase(bounds));
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 8, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), point -> {
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 8, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), tooltipContext -> {
List<Text> list = Lists.newArrayList();
list.add(Text.of("Energy"));
list.add(Text.translatable("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
list.add(Text.of(""));
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
return Tooltip.create(point, list);
return Tooltip.create(tooltipContext.getPoint(), list);
}));
return widgets;
}

View file

@ -52,13 +52,13 @@ public class GrinderCategory<R extends RebornRecipe> extends AbstractMachineCate
public List<Widget> setupDisplay(MachineRecipeDisplay<R> recipeDisplay, Rectangle bounds) {
List<Widget> widgets = Lists.newArrayList();
widgets.add(Widgets.createRecipeBase(bounds));
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 18, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), point -> {
widgets.add(ReiPlugin.createEnergyDisplay(new Rectangle(bounds.x + 8, bounds.y + 18, 14, 50), recipeDisplay.getEnergy(), ReiPlugin.EntryAnimation.downwards(5000), tooltipContext -> {
List<Text> list = Lists.newArrayList();
list.add(Text.of("Energy"));
list.add(Text.translatable("techreborn.jei.recipe.running.cost", "E", recipeDisplay.getEnergy()).formatted(Formatting.GRAY));
list.add(Text.of(""));
list.add(ClientHelper.getInstance().getFormattedModFromIdentifier(new Identifier("techreborn", "")));
return Tooltip.create(point, list);
return Tooltip.create(tooltipContext.getPoint(), list);
}));
widgets.add(Widgets.createSlot(new Point(bounds.x + 55, bounds.y + 36)).entries(getInput(recipeDisplay, 0)).markInput());
widgets.add(Widgets.createSlot(new Point(bounds.x + 55 + 46, bounds.y + 36 - 9 - 18)).entries(getOutput(recipeDisplay, 0)).markOutput());