CtrlQ上传处理样板写入搜索名称修正
This commit is contained in:
parent
249dbaa791
commit
2be3671902
|
|
@ -336,6 +336,19 @@ public final class CtrlQPatternKeyHandler {
|
|||
|
||||
private static void setLastProcessingNameFromRecipe(Object recipeBase) {
|
||||
String name = null;
|
||||
|
||||
// 处理 RecipeHolder
|
||||
if (recipeBase != null && "net.minecraft.world.item.crafting.RecipeHolder".equals(recipeBase.getClass().getName())) {
|
||||
try {
|
||||
var valueMethod = recipeBase.getClass().getMethod("value");
|
||||
Object actualRecipe = valueMethod.invoke(recipeBase);
|
||||
if (actualRecipe != null) {
|
||||
recipeBase = actualRecipe;
|
||||
}
|
||||
} catch (Throwable ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
if (recipeBase instanceof Recipe<?> recipe) {
|
||||
name = ExtendedAEPatternUploadUtil.mapRecipeTypeToSearchKey(recipe);
|
||||
} else if (recipeBase != null
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user