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

@ -25,8 +25,8 @@
package reborncore.client;
import net.minecraft.client.MinecraftClient;
import net.minecraft.network.MessageSender;
import net.minecraft.network.MessageType;
import net.minecraft.network.message.MessageSender;
import net.minecraft.network.message.MessageType;
import net.minecraft.text.Text;
import net.minecraft.util.Util;
import net.minecraft.util.registry.Registry;

View file

@ -6,13 +6,13 @@ org.gradle.jvmargs=-Xmx2G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.19-pre1
yarn_version=1.19-pre1+build.7
minecraft_version=1.19-rc1
yarn_version=1.19-rc1+build.2
loader_version=0.14.6
fapi_version=0.53.1+1.19
fapi_version=0.55.0+1.19
# Dependencies
energy_version=2.2.0
rei_version=9.0.462
rei_version=9.0.466
trinkets_version=3.0.2
dashloader_version=2.0

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());

View file

@ -32,7 +32,7 @@ import techreborn.test.TRGameTest
import techreborn.test.TRTestContext
class GrinderTest extends TRGameTest {
@GameTest(structureName = "fabric-gametest-api-v1:empty", tickLimit = 150)
@GameTest(templateName = "fabric-gametest-api-v1:empty", tickLimit = 150)
def testGrind2OCs(TRTestContext context) {
/**
* Test that grinder with 2 overclocker upgrades grinds coal into coal dust in 116 ticks

View file

@ -34,7 +34,7 @@ import techreborn.test.TRGameTest
import techreborn.test.TRTestContext
class IronAlloyFurnaceTest extends TRGameTest {
@GameTest(structureName = "fabric-gametest-api-v1:empty", tickLimit = 2000)
@GameTest(templateName = "fabric-gametest-api-v1:empty", tickLimit = 2000)
def testIronAlloyFurnaceElectrumAlloyIngot(TRTestContext context) {
/**
* Test that the Iron Alloy Furnace smelts a gold ingot and a silver ingot into an electrum alloy ingot in 200

View file

@ -35,7 +35,7 @@ import techreborn.test.TRGameTest
import techreborn.test.TRTestContext
class IronFurnaceTest extends TRGameTest {
@GameTest(structureName = "fabric-gametest-api-v1:empty", tickLimit = 2000)
@GameTest(templateName = "fabric-gametest-api-v1:empty", tickLimit = 2000)
def testIronFurnaceSmeltRawIron(TRTestContext context) {
/**
* Test that the Iron Furnace smelts a raw iron ore into an iron ingot in 200 ticks
@ -49,7 +49,7 @@ class IronFurnaceTest extends TRGameTest {
}
}
@GameTest(structureName = "fabric-gametest-api-v1:empty", tickLimit = 2000)
@GameTest(templateName = "fabric-gametest-api-v1:empty", tickLimit = 2000)
def testIronFurnaceSmeltRawIronBlock(TRTestContext context) {
/**
* Test that the Iron Furnace smelts a raw iron block into an iron block in 1500 ticks instead of 200

View file

@ -36,7 +36,7 @@ import techreborn.test.TRTestContext
* A bit of a mess, but checks that we can ser/de all recipes to and from json.
*/
class RecipeSyncTests extends TRGameTest {
@GameTest(structureName = "fabric-gametest-api-v1:empty", tickLimit = 150)
@GameTest(templateName = "fabric-gametest-api-v1:empty", tickLimit = 150)
def testRecipes(TRTestContext context) {
def recipeTypes = RecipeManager.getRecipeTypes("techreborn")

View file

@ -24,8 +24,7 @@
package techreborn.init;
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.Items;
import net.minecraft.loot.LootPool;
@ -52,9 +51,9 @@ public class ModLoot {
LootPoolEntry basicCircuit = makeEntry(Parts.ELECTRONIC_CIRCUIT);
LootPoolEntry rubberSapling = makeEntry(TRContent.RUBBER_SAPLING, 25);
LootPool poolBasic = FabricLootPoolBuilder.builder().withEntry(copperIngot).withEntry(tinIngot)
.withEntry(leadIngot).withEntry(silverIngot).withEntry(refinedIronIngot).withEntry(advancedAlloyIngot)
.withEntry(basicFrame).withEntry(basicCircuit).withEntry(rubberSapling).rolls(UniformLootNumberProvider.create(1.0f, 2.0f))
LootPool poolBasic = LootPool.builder().with(copperIngot).with(tinIngot)
.with(leadIngot).with(silverIngot).with(refinedIronIngot).with(advancedAlloyIngot)
.with(basicFrame).with(basicCircuit).with(rubberSapling).rolls(UniformLootNumberProvider.create(1.0f, 2.0f))
.build();
LootPoolEntry aluminumIngot = makeEntry(Ingots.ALUMINUM);
@ -67,9 +66,9 @@ public class ModLoot {
LootPoolEntry advancedCircuit = makeEntry(Parts.ADVANCED_CIRCUIT);
LootPoolEntry dataStorageChip = makeEntry(Parts.DATA_STORAGE_CHIP);
LootPool poolAdvanced = FabricLootPoolBuilder.builder().withEntry(aluminumIngot).withEntry(electrumIngot)
.withEntry(invarIngot).withEntry(nickelIngot).withEntry(steelIngot).withEntry(zincIngot)
.withEntry(advancedFrame).withEntry(advancedCircuit).withEntry(dataStorageChip).rolls(UniformLootNumberProvider.create(1.0f, 3.0f))
LootPool poolAdvanced = LootPool.builder().with(aluminumIngot).with(electrumIngot)
.with(invarIngot).with(nickelIngot).with(steelIngot).with(zincIngot)
.with(advancedFrame).with(advancedCircuit).with(dataStorageChip).rolls(UniformLootNumberProvider.create(1.0f, 3.0f))
.build();
LootPoolEntry chromeIngot = makeEntry(Ingots.CHROME);
@ -82,19 +81,19 @@ public class ModLoot {
LootPoolEntry industrialCircuit = makeEntry(Parts.INDUSTRIAL_CIRCUIT);
LootPoolEntry energyFlowChip = makeEntry(Parts.ENERGY_FLOW_CHIP);
LootPool poolIndustrial = FabricLootPoolBuilder.builder().withEntry(chromeIngot).withEntry(iridiumIngot)
.withEntry(platinumIngot).withEntry(titaniumIngot).withEntry(tungstenIngot).withEntry(tungstensteelIngot)
.withEntry(industrialFrame).withEntry(industrialCircuit).withEntry(energyFlowChip).rolls(UniformLootNumberProvider.create(1.0f, 3.0f))
LootPool poolIndustrial = LootPool.builder().with(chromeIngot).with(iridiumIngot)
.with(platinumIngot).with(titaniumIngot).with(tungstenIngot).with(tungstensteelIngot)
.with(industrialFrame).with(industrialCircuit).with(energyFlowChip).rolls(UniformLootNumberProvider.create(1.0f, 3.0f))
.build();
LootPoolEntry rubber = ItemEntry.builder(Parts.RUBBER).weight(10).build();
LootPoolEntry treeTap = ItemEntry.builder(TRContent.TREE_TAP).weight(10)
.apply(SetDamageLootFunction.builder(UniformLootNumberProvider.create(0.0f, 0.9f))).build();
LootPool poolFishingJunk = FabricLootPoolBuilder.builder().withEntry(rubber).withEntry(treeTap).build();
LootPool poolFishingJunk = LootPool.builder().with(rubber).with(treeTap).build();
LootTableLoadingCallback.EVENT.register((resourceManager, lootManager, ident, supplier, setter) -> {
String stringId = ident.toString();
LootTableEvents.MODIFY.register((resourceManager, lootManager, id, tableBuilder, source) -> {
String stringId = id.toString();
if (!stringId.startsWith("minecraft:chests")) {
return;
}
@ -111,16 +110,16 @@ public class ModLoot {
"minecraft:chests/village/village_weaponsmith",
"minecraft:chests/village/village_armorer",
"minecraft:chests/village/village_toolsmith"
-> supplier.withPool(poolBasic);
-> tableBuilder.pool(poolBasic);
case "minecraft:chests/stronghold_corridor",
"minecraft:chests/stronghold_crossing",
"minecraft:chests/stronghold_library",
"minecraft:chest/underwater_ruin_big",
"minecraft:chests/pillager_outpost"
-> supplier.withPool(poolAdvanced);
-> tableBuilder.pool(poolAdvanced);
case "minecraft:chests/woodland_mansion",
"minecraft:chests/ancient_city"
-> supplier.withPool(poolIndustrial);
-> tableBuilder.pool(poolIndustrial);
}
}
@ -130,23 +129,24 @@ public class ModLoot {
stringId.equals("minecraft:chests/bastion_hoglin_stable") ||
stringId.equals("minecraft:chests/bastion_treasure") ||
stringId.equals("minecraft:chests/bastion_other")) {
supplier.withPool(poolAdvanced);
tableBuilder.pool(poolAdvanced);
}
}
if (TechRebornConfig.enableEndLoot) {
if (stringId.equals("minecraft:chests/end_city_treasure")) {
supplier.withPool(poolIndustrial);
tableBuilder.pool(poolIndustrial);
}
}
if (TechRebornConfig.enableFishingJunkLoot) {
if (stringId.equals("minecraft:gameplay/fishing/junk")) {
supplier.withPool(poolFishingJunk);
tableBuilder.pool(poolFishingJunk);
}
}
return;
});
}
/**