Skip to content

Commit a4d9eb8

Browse files
authored
Merge pull request #765 from Mosklia/1.21.1-fix-enchanter
Fix enchanter cannot enchant items
2 parents a38623b + 7edd600 commit a4d9eb8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/de/dafuqs/spectrum/blocks/enchanter/EnchanterBlockEntity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ private static boolean checkRecipeRequirements(Level world, BlockPos blockPos, @
304304
return false;
305305
}
306306
if (enchanter.currentRecipe == null) {
307-
return false;
307+
// Hard-coded center enchanting recipe has no serialized recipe, so currentRecipe == null
308+
// does not mean the enchanter has no valid recipe.
309+
return isValidCenterEnchantingSetup(enchanter);
308310
}
309311

310312
var recipe = enchanter.currentRecipe.value();
@@ -579,7 +581,7 @@ public static Vec3i getItemBowlPositionOffset(int index, int orientation, boolea
579581

580582
private static boolean recipeMatches(EnchanterBlockEntity blockEntity, Level world) {
581583
if (blockEntity.currentRecipe == null) {
582-
return false;
584+
return isValidCenterEnchantingSetup(blockEntity);
583585
}
584586
if (blockEntity.currentRecipe.value() instanceof EnchanterRecipe recipe) {
585587
return recipe.matches(blockEntity.virtualInventory.createInput(), world);

0 commit comments

Comments
 (0)