Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/main/java/dev/dubhe/anvilcraft/event/BlockEventListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,18 @@ public static void onRightClickBlock(PlayerInteractEvent.RightClickBlock event)
onAnvilFixed(level, stack, pos, targetState);
event.setCancellationResult(InteractionResult.SUCCESS);
event.setCanceled(true);
} else if (targetState.getBlock() instanceof BaseBatchCraftingBlock target && player.isShiftKeyDown() && !level.isClientSide) {
} else if (targetState.getBlock() instanceof BaseBatchCraftingBlock target && player.isShiftKeyDown()) {
for (Supplier<BaseBatchCraftingBlock> getter : BaseBatchCraftingBlock.getBatchCraftingBlockGetters()) {
BaseBatchCraftingBlock block = getter.get();
if (!stack.is(block.getToastSymbol())) continue;
level.removeBlock(pos, false);
level.removeBlockEntity(pos);
level.setBlockAndUpdate(pos, BaseBatchCraftingBlock.copy(targetState, block.defaultBlockState()));
Block.popResourceFromFace(level, pos, Direction.UP, target.getToastSymbol().getDefaultInstance().copyWithCount(1));
stack.shrink(1);
if (!level.isClientSide) {
level.setBlockAndUpdate(pos, BaseBatchCraftingBlock.copy(targetState, block.defaultBlockState()));
Block.popResourceFromFace(level, pos, Direction.UP, target.getToastSymbol().getDefaultInstance().copyWithCount(1));
stack.shrink(1);
}
event.setCancellationResult(InteractionResult.CONSUME);
event.setCanceled(true);
Comment thread
QiuShui1012 marked this conversation as resolved.
return;
}
}
}
Expand Down
Loading