Skip to content

Commit aee7523

Browse files
committed
Merge remote-tracking branch 'origin/1.21.1-aria-for-painters-mojmap' into 1.21.1-aria-for-painters-mojmap
2 parents 1d7fc7d + 61ac9af commit aee7523

2 files changed

Lines changed: 6 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);

src/main/java/de/dafuqs/spectrum/blocks/redstone/BlockBreakerBlock.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,12 @@ public void breakBlock(Level world, BlockPos pos, Player breaker) {
106106
if (BREAK_STACK == null) { // we initialize the item here instead of it being final because of load order shenanigans
107107
BREAK_STACK = new ItemStack(SpectrumItems.MALACHITE_WORKSTAFF);
108108
}
109+
Block block = blockState.getBlock();
109110
Block.dropResources(blockState, world, pos, blockEntity, breaker, BREAK_STACK);
110111

111112
if (world.setBlock(pos, fluidState.createLegacyBlock(), Block.UPDATE_ALL, 512)) {
112113
world.gameEvent(GameEvent.BLOCK_DESTROY, pos, GameEvent.Context.of(breaker, blockState));
114+
block.destroy(world, pos, blockState);
113115
}
114116
}
115117

0 commit comments

Comments
 (0)