Skip to content

Commit efe3bec

Browse files
authored
Merge pull request #26 from FTBTeam/dev
Dev
2 parents ed34fd1 + d5abed1 commit efe3bec

File tree

11 files changed

+56
-28
lines changed

11 files changed

+56
-28
lines changed

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ 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+
## [21.1.0]
8+
9+
### Changed
10+
* Ported to MC 1.21.1
11+
12+
### Fixed
13+
* Fixed a null itemstack client crash which happens under some circumstances (could not reproduce, but added extra guards to catch this)
14+
715
## [3.2.2]
816

917
### Fixed

Diff for: build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id "architectury-plugin" version "3.4-SNAPSHOT"
3-
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
3+
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
44
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
55
}
66

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void setRecipe(IRecipeLayoutBuilder builder, WrappedLootCrate recipe, IFo
8484
int finalSlot = slot;
8585
builder.addSlot(RecipeIngredientRole.OUTPUT, (slot % WrappedLootCrate.ITEMSX) * 18, (slot / WrappedLootCrate.ITEMSX) * 18 + 36)
8686
.addIngredients(recipe.outputIngredients().get(slot))
87-
.addTooltipCallback((recipeSlotView, tooltip) -> recipeSlotView.getDisplayedIngredient()
87+
.addRichTooltipCallback((recipeSlotView, tooltip) -> recipeSlotView.getDisplayedIngredient()
8888
.flatMap(ingr -> ingr.getIngredient(VanillaTypes.ITEM_STACK)).ifPresent(stack -> {
8989
if (ItemStack.isSameItemSameComponents(stack, recipe.outputs.get(finalSlot))) {
9090
String chanceStr = ChatFormatting.GOLD + WeightedReward.chanceString(

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

+24-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
import mezz.jei.api.gui.builder.IRecipeLayoutBuilder;
99
import mezz.jei.api.gui.drawable.IDrawable;
1010
import mezz.jei.api.gui.ingredient.IRecipeSlotsView;
11+
import mezz.jei.api.gui.inputs.IJeiInputHandler;
12+
import mezz.jei.api.gui.inputs.IJeiUserInput;
13+
import mezz.jei.api.gui.widgets.IRecipeExtrasBuilder;
1114
import mezz.jei.api.helpers.IGuiHelper;
1215
import mezz.jei.api.recipe.IFocusGroup;
1316
import mezz.jei.api.recipe.RecipeIngredientRole;
@@ -17,13 +20,16 @@
1720
import net.minecraft.client.Minecraft;
1821
import net.minecraft.client.gui.Font;
1922
import net.minecraft.client.gui.GuiGraphics;
23+
import net.minecraft.client.gui.navigation.ScreenRectangle;
2024
import net.minecraft.network.chat.Component;
2125
import net.minecraft.resources.ResourceLocation;
2226
import net.minecraft.world.item.ItemStack;
2327

2428
public class QuestCategory implements IRecipeCategory<WrappedQuest> {
2529
public static final ResourceLocation TEXTURE = ResourceLocation.fromNamespaceAndPath(FTBQuestsAPI.MOD_ID, "textures/gui/jei/quest.png");
2630

31+
private static final ScreenRectangle INPUT_AREA = new ScreenRectangle(0, 0, 144, 20);
32+
2733
private final IDrawable background;
2834
private final IDrawable icon;
2935

@@ -32,6 +38,11 @@ public QuestCategory(IGuiHelper guiHelper) {
3238
icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(ModItems.BOOK.get()));
3339
}
3440

41+
@Override
42+
public void createRecipeExtras(IRecipeExtrasBuilder builder, WrappedQuest recipe, IFocusGroup focuses) {
43+
builder.addInputHandler(new ClickHandler(INPUT_AREA, recipe));
44+
}
45+
3546
@Override
3647
public Component getTitle() {
3748
return Component.translatable("ftbquests.quests");
@@ -78,12 +89,19 @@ public void draw(WrappedQuest recipe, IRecipeSlotsView recipeSlotsView, GuiGraph
7889
graphics.drawString(font, text, x, y, highlight ? 0xFFA87A5E : 0xFF3F2E23, false);
7990
}
8091

81-
@Override
82-
public boolean handleInput(WrappedQuest recipe, double mouseX, double mouseY, InputConstants.Key input) {
83-
if (input.getType() == InputConstants.Type.MOUSE && mouseY >= 0 && mouseY < 20) {
84-
recipe.openQuestGui();
85-
return true;
92+
public record ClickHandler(ScreenRectangle area, WrappedQuest recipe) implements IJeiInputHandler {
93+
@Override
94+
public ScreenRectangle getArea() {
95+
return area;
96+
}
97+
98+
@Override
99+
public boolean handleInput(double mouseX, double mouseY, IJeiUserInput input) {
100+
if (input.getKey().getType() == InputConstants.Type.MOUSE) {
101+
recipe.openQuestGui();
102+
return true;
103+
}
104+
return false;
86105
}
87-
return false;
88106
}
89107
}

Diff for: common/src/main/java/dev/ftb/mods/ftbxmodcompat/ftbquests/recipemod_common/ItemStackToListCache.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import java.util.function.Function;
99

1010
/**
11-
* An LRU cache to quickly map an itemstack (with possible NBT) to a list of something (either wrapped quest or loot
12-
* crate "recipes"). Important for fast JEI/REI lookup.
11+
* An LRU cache to quickly map an itemstack (with possible component data) to a list of something (either wrapped
12+
* quest or loot crate "recipes"). Important for fast JEI/REI lookup.
1313
*
1414
* @param <T> type of recipe being mapped to
1515
*/
@@ -44,7 +44,8 @@ public int hashCode(ItemStack object) {
4444

4545
@Override
4646
public boolean equals(ItemStack o1, ItemStack o2) {
47-
return ItemStack.isSameItemSameComponents(o1, o2);
47+
// they _shouldn't_ ever be null, but it's apparently happened...
48+
return o1 != null && o2 != null && ItemStack.isSameItemSameComponents(o1, o2);
4849
}
4950
}
5051
}

Diff for: fabric/build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ processResources {
6767
filesMatching("fabric.mod.json") {
6868
expand "version": project.version,
6969
"archversion": project.architectury_version,
70-
"neoforgeversion": project.neoforge_version,
71-
"neoforgeloaderversion": project.neoforge_loader_version,
70+
"fabricversionrange": project.fabric_api_version_range,
7271
"mcversion": project.minecraft_version,
7372
"ftblibraryversion": project.ftb_library_version,
7473
"ftbquestsversion": project.ftb_quests_version,

Diff for: fabric/src/main/resources/fabric.mod.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
]
2323
},
2424
"depends": {
25-
"fabric": "*",
25+
"fabric": "${fabricversionrange}",
2626
"minecraft": ">=${mcversion}",
2727
"architectury": ">=${archversion}",
2828
"ftblibrary": ">=${ftblibraryversion}"

Diff for: gradle.properties

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
11
org.gradle.jvmargs=-Xmx2048M
22

3-
minecraft_version=1.21
3+
minecraft_version=1.21.1
44
#enabled_platforms=fabric,forge,neoforge
55
enabled_platforms=fabric,neoforge
66

77
archives_base_name=ftb-xmod-compat
88
readable_name=FTB XMod Compat
9-
mod_version=3.2.2
9+
mod_version=21.1.0
1010
maven_group=dev.ftb.mods
1111
curseforge_id=889915
1212

1313
forge_version=50.0.9
14-
neoforge_version=21.0.43-beta
14+
neoforge_version=21.1.13
15+
neoforge_version_range=[21.1.0,)
1516
neoforge_loader_version=4
1617
fabric_loader_version=0.15.11
1718
fabric_api_version=0.100.1+1.21
19+
fabric_api_version_range=>=0.100.1+1.21
1820

19-
architectury_version=13.0.2
21+
architectury_version=13.0.6
2022

21-
ftb_library_version=2100.1.2
22-
ftb_quests_version=2100.1.1
23-
ftb_chunks_version=2100.1.0
23+
ftb_library_version=2101.1.1
24+
ftb_quests_version=2101.1.0
25+
ftb_chunks_version=2101.1.0
2426
ftb_ranks_version=2100.1.0
25-
ftb_essentials_version=2100.1.0
26-
ftb_teams_version=2100.1.0
27-
ftb_filter_system_version=3.0.0
27+
ftb_essentials_version=2101.1.0
28+
ftb_teams_version=2101.1.0
29+
ftb_filter_system_version=21.0.0
2830

2931
rei_version=16.0.729
3032
common_prot_api_version=1.0.0
@@ -35,7 +37,7 @@ waystones_fabric_version=5427150
3537
balm_neoforge_version=5438018
3638
balm_forge_version=5438000
3739
balm_fabric_version=5437997
38-
jei_version=19.0.0.11
40+
jei_version=19.8.5.118
3941
kubejs_version=2100.7.0-build.56
4042

4143
# TODO compiling against 1.20.4 version for now

Diff for: gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

Diff for: neoforge/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ processResources {
6464
filesMatching("META-INF/neoforge.mods.toml") {
6565
expand "version": project.version,
6666
"archversion": project.architectury_version,
67-
"neoforgeversion": project.neoforge_version,
67+
"neoforgeversionrange": project.neoforge_version_range,
6868
"neoforgeloaderversion": project.neoforge_loader_version,
6969
"mcversion": project.minecraft_version,
7070
"ftblibraryversion": project.ftb_library_version,

Diff for: neoforge/src/main/resources/META-INF/neoforge.mods.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Provides cross-mod compatibilty/integration for all main FTB mods
1616
[[dependencies.ftbxmodcompat]]
1717
modId = "neoforge"
1818
type = "required"
19-
versionRange = "[${neoforgeversion},)"
19+
versionRange = "${neoforgeversionrange}"
2020
ordering = "NONE"
2121
side = "BOTH"
2222

0 commit comments

Comments
 (0)