diff --git a/src/main/java/com/gregtechceu/gtceu/common/block/SurfaceRockBlock.java b/src/main/java/com/gregtechceu/gtceu/common/block/SurfaceRockBlock.java index 48fd29709b..9a0be75eaf 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/block/SurfaceRockBlock.java +++ b/src/main/java/com/gregtechceu/gtceu/common/block/SurfaceRockBlock.java @@ -28,6 +28,7 @@ import net.minecraft.world.level.block.state.StateDefinition; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.material.FluidState; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; @@ -66,6 +67,19 @@ public SurfaceRockBlock(Properties properties, Material material) { } } + @Override + public boolean onDestroyedByPlayer(BlockState state, Level level, BlockPos pos, Player player, boolean willHarvest, + FluidState fluid) { + if (!level.isClientSide) { + ServerCache.instance.prospectSurfaceRockMaterial( + level.dimension(), + this.material, + pos, + (ServerPlayer) player); + } + return super.onDestroyedByPlayer(state, level, pos, player, willHarvest, fluid); + } + @Override @SuppressWarnings("deprecation") public InteractionResult use(BlockState state, Level level, BlockPos pos, Player player, InteractionHand hand,