11package dev .compactmods .crafting .proxies .block ;
22
33import javax .annotation .Nullable ;
4+ import dev .compactmods .crafting .api .EnumCraftingState ;
45import dev .compactmods .crafting .field .capability .CapabilityMiniaturizationField ;
56import dev .compactmods .crafting .proxies .data .BaseFieldProxyEntity ;
67import dev .compactmods .crafting .proxies .data .RescanFieldProxyEntity ;
7- import dev .compactmods .crafting .api .field .IMiniaturizationField ;
88import net .minecraft .block .Block ;
99import net .minecraft .block .BlockState ;
1010import net .minecraft .tileentity .TileEntity ;
@@ -31,20 +31,19 @@ public TileEntity createTileEntity(BlockState state, IBlockReader world) {
3131
3232 @ Override
3333 public void neighborChanged (BlockState thisState , World level , BlockPos thisPos , Block changedBlock , BlockPos changedPos , boolean _b ) {
34- if (!level .isClientSide ) {
35- BaseFieldProxyEntity tile = (BaseFieldProxyEntity ) level .getBlockEntity (thisPos );
36-
37- doRescanRedstone (level , thisPos , tile );
34+ if (level .isClientSide ) {
35+ return ;
3836 }
39- }
37+ BaseFieldProxyEntity tile = ( BaseFieldProxyEntity ) level . getBlockEntity ( thisPos );
4038
41- private void doRescanRedstone (World level , BlockPos thisPos , BaseFieldProxyEntity tile ) {
4239 if (level .hasNeighborSignal (thisPos )) {
4340 // call recipe scan
44-
4541 if (tile != null ) {
4642 tile .getCapability (CapabilityMiniaturizationField .MINIATURIZATION_FIELD )
47- .ifPresent (IMiniaturizationField ::fieldContentsChanged );
43+ .ifPresent (field -> {
44+ if (field .getCraftingState () != EnumCraftingState .CRAFTING )
45+ field .fieldContentsChanged ();
46+ });
4847 }
4948 }
5049 }
0 commit comments