Skip to content

Commit e751d28

Browse files
authored
Merge pull request #20 from FTBTeam/1.20.4/dev
1.20.4/dev
2 parents 2bc86a4 + 99d5e80 commit e751d28

File tree

7 files changed

+45
-16
lines changed

7 files changed

+45
-16
lines changed

Diff for: CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [3.0.4]
8+
9+
### Added
10+
* Support for FTB Quests recipe querying for fluid tasks / fluid ingredients
11+
712
## [3.0.3]
813

914
### Fixed

Diff for: common/src/main/java/dev/ftb/mods/ftbxmodcompat/ftbquests/jei/FTBQuestsJEIIntegration.java

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.ftb.mods.ftbxmodcompat.ftbquests.jei;
22

3+
import dev.architectury.fluid.FluidStack;
34
import dev.ftb.mods.ftbquests.client.ClientQuestFile;
45
import dev.ftb.mods.ftbxmodcompat.FTBXModCompat;
56
import dev.ftb.mods.ftbxmodcompat.ftbquests.QuestItems;
@@ -74,4 +75,14 @@ public static void showRecipes(ItemStack stack) {
7475
));
7576
}
7677
}
78+
79+
public static void showRecipes(FluidStack stack) {
80+
if (runtime != null) {
81+
var nativeStack = runtime.getJeiHelpers().getPlatformFluidHelper().create(stack.getFluid(), stack.getAmount());
82+
runtime.getIngredientManager().getIngredientTypeChecked(nativeStack)
83+
.ifPresent(type -> runtime.getRecipesGui().show(
84+
runtime.getJeiHelpers().getFocusFactory().createFocus(RecipeIngredientRole.OUTPUT, type, nativeStack)
85+
));
86+
}
87+
}
7788
}

Diff for: common/src/main/java/dev/ftb/mods/ftbxmodcompat/ftbquests/jei/helper/JEIRecipeHelper.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.ftb.mods.ftbxmodcompat.ftbquests.jei.helper;
22

3+
import dev.architectury.fluid.FluidStack;
34
import dev.ftb.mods.ftbxmodcompat.FTBXModCompat;
45
import dev.ftb.mods.ftbxmodcompat.ftbquests.jei.FTBQuestsJEIIntegration;
56
import dev.ftb.mods.ftbxmodcompat.ftbquests.jei.LootCrateRecipeManagerPlugin;
@@ -17,6 +18,11 @@ public void showRecipes(ItemStack itemStack) {
1718
FTBQuestsJEIIntegration.showRecipes(itemStack);
1819
}
1920

21+
@Override
22+
public void showRecipes(FluidStack fluidStack) {
23+
FTBQuestsJEIIntegration.showRecipes(fluidStack);
24+
}
25+
2026
@Override
2127
public String getHelperName() {
2228
return "JEI";

Diff for: common/src/main/java/dev/ftb/mods/ftbxmodcompat/ftbquests/rei/FTBQuestsREIIntegration.java

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
package dev.ftb.mods.ftbxmodcompat.ftbquests.rei;
22

3+
import dev.architectury.fluid.FluidStack;
34
import dev.ftb.mods.ftbxmodcompat.FTBXModCompat;
45
import dev.ftb.mods.ftbxmodcompat.ftbquests.recipemod_common.WrappedLootCrate;
56
import dev.ftb.mods.ftbxmodcompat.ftbquests.recipemod_common.WrappedQuest;
6-
import me.shedaniel.math.Rectangle;
77
import me.shedaniel.rei.api.client.entry.filtering.base.BasicFilteringRule;
88
import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
99
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
1010
import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
11-
import me.shedaniel.rei.api.client.registry.screen.ExclusionZones;
12-
import me.shedaniel.rei.api.client.registry.screen.ExclusionZonesProvider;
1311
import me.shedaniel.rei.api.client.view.ViewSearchBuilder;
1412
import me.shedaniel.rei.api.common.entry.EntryStack;
1513
import me.shedaniel.rei.api.common.entry.type.EntryDefinition;
14+
import me.shedaniel.rei.api.common.entry.type.EntryType;
1615
import me.shedaniel.rei.api.common.entry.type.EntryTypeRegistry;
1716
import me.shedaniel.rei.api.common.entry.type.VanillaEntryTypes;
18-
import net.minecraft.client.gui.screens.Screen;
1917
import net.minecraft.world.item.ItemStack;
2018

21-
import java.util.Collection;
22-
2319
public class FTBQuestsREIIntegration implements REIClientPlugin {
2420
private static BasicFilteringRule.MarkDirty cratesChanged;
2521

@@ -50,12 +46,17 @@ public void registerBasicEntryFiltering(BasicFilteringRule<?> rule) {
5046
}
5147

5248
public static void showRecipes(ItemStack stack) {
53-
for (EntryDefinition<?> definition : EntryTypeRegistry.getInstance().values()) {
54-
if (definition.getType() == VanillaEntryTypes.ITEM) {
55-
ViewSearchBuilder.builder()
56-
.addRecipesFor(EntryStack.of(VanillaEntryTypes.ITEM, stack))
57-
.open();
58-
}
49+
showRecipes(stack, VanillaEntryTypes.ITEM);
50+
}
51+
52+
public static void showRecipes(FluidStack stack) {
53+
showRecipes(stack, VanillaEntryTypes.FLUID);
54+
}
55+
56+
private static <T> void showRecipes(T stack, EntryType<T> type) {
57+
EntryDefinition<T> definition = EntryTypeRegistry.getInstance().get(type);
58+
if (definition != null) {
59+
ViewSearchBuilder.builder().addRecipesFor(EntryStack.of(definition, stack)).open();
5960
}
6061
}
6162

Diff for: common/src/main/java/dev/ftb/mods/ftbxmodcompat/ftbquests/rei/helper/REIRecipeHelper.java

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package dev.ftb.mods.ftbxmodcompat.ftbquests.rei.helper;
22

3+
import dev.architectury.fluid.FluidStack;
34
import dev.ftb.mods.ftbxmodcompat.ftbquests.recipemod_common.BaseRecipeHelper;
45
import dev.ftb.mods.ftbxmodcompat.ftbquests.rei.FTBQuestsREIIntegration;
56
import dev.ftb.mods.ftbxmodcompat.ftbquests.rei.LootCrateDisplayGenerator;
@@ -12,6 +13,11 @@ public void showRecipes(ItemStack stack) {
1213
FTBQuestsREIIntegration.showRecipes(stack);
1314
}
1415

16+
@Override
17+
public void showRecipes(FluidStack stack) {
18+
FTBQuestsREIIntegration.showRecipes(stack);
19+
}
20+
1521
@Override
1622
public String getHelperName() {
1723
return "REI";

Diff for: gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ minecraft_version=1.20.4
44
enabled_platforms=fabric,forge,neoforge
55

66
archives_base_name=ftb-xmod-compat
7-
mod_version=3.0.3
7+
mod_version=3.0.4
88
maven_group=dev.ftb.mods
99
curseforge_id=889915
1010

@@ -16,8 +16,8 @@ fabric_api_version=0.96.4+1.20.4
1616

1717
architectury_version=11.1.17
1818

19-
ftb_library_version=2004.2.0
20-
ftb_quests_version=2004.2.0
19+
ftb_library_version=2004.2.4
20+
ftb_quests_version=2004.2.1
2121
ftb_chunks_version=2004.1.2
2222
ftb_ranks_version=2004.2.0
2323
ftb_essentials_version=2004.1.1

Diff for: neoforge/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ if (ENV.CURSEFORGE_KEY) {
143143
project {
144144
id = project.curseforge_id
145145
releaseType = ftbPublishing.relType
146-
addGameVersion "Forge"
146+
addGameVersion "NeoForge"
147147
addGameVersion project.minecraft_version
148148
mainArtifact(remapJar.archiveFile)
149149
relations {

0 commit comments

Comments
 (0)